11import os
2- import sys
32import time
4- import json
53import pygame
64import librosa
75import numpy as np
@@ -138,17 +136,17 @@ def load_audio_analysis(file_path):
138136 print (f"{ Colors .BLUE } ⏳ Advanced BPM Analysis (Full Song + Phase Check) in progress...{ Colors .ENDC } " )
139137 try :
140138 # 1. Audio Loading
141- print (f " Full audio loaded (22050Hz)..." )
139+ print (" Full audio loaded (22050Hz)..." )
142140 y , sr = librosa .load (file_path , sr = 22050 )
143141 total_duration = librosa .get_duration (y = y , sr = sr )
144142
145143 # 2. Onset Envelope
146144 hop_len = 128
147- print (f " Computing Onset Envelope..." )
145+ print (" Computing Onset Envelope..." )
148146 onset_env = librosa .onset .onset_strength (y = y , sr = sr , hop_length = hop_len )
149147
150148 # 3. Generate Candidates
151- print (f " Generating BPM Candidates (FFT + Autocorr)..." )
149+ print (" Generating BPM Candidates (FFT + Autocorr)..." )
152150 # We reduce base n_candidates to be more selective
153151 fft_candidates = get_top_bpm_candidates_fft (onset_env , sr , hop_len , n_candidates = 4 )
154152 ac_candidates = get_candidates_autocorr (onset_env , sr , hop_len , n_candidates = 4 )
@@ -165,7 +163,6 @@ def load_audio_analysis(file_path):
165163
166164 # Generate Variants (with score penalty)
167165 final_pool = []
168- seen_bpms = []
169166
170167 def add_candidate (bpm , score ):
171168 if not (40 <= bpm <= 250 ): return
@@ -395,7 +392,6 @@ def generate_tick_sound(freq, duration_sec, sr):
395392 clock = pygame .time .Clock ()
396393
397394 # Playback Time Management
398- music_start_time = time .time ()
399395 playback_offset = 0.0 # Temporal offset due to seeks (forward/backward)
400396
401397 # Volume Control
0 commit comments