Fix DeprecationWarning in BPM rounding; ensure BPM tags are correctly written and updated

This commit is contained in:
Roncero Blanco, Edgar
2025-05-26 17:24:00 +02:00
parent 76d25ebe5e
commit 1f83bb8517

View File

@@ -38,7 +38,7 @@ def analyze_bpm_librosa(file_path):
try:
y, sr = librosa.load(file_path, mono=True)
tempo, _ = librosa.beat.beat_track(y=y, sr=sr)
return int(round(float(tempo)))
return int(round(float(tempo[0])))
except Exception as e:
print(f"Error analyzing BPM for {file_path.name}: {e}")
return None