beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.57k stars 1.8k forks source link

Fix for #5289 #5322

Open tumbleboy opened 1 week ago

tumbleboy commented 1 week ago

Description

Fixes #5289

As stated in issue 5289, tempo, _ = beat.beat_track(y=y, sr=sr) was assigning a numpy.ndarray to tempo. Trying to use Pythons built-in round() method doesn't work, so as suggested in the issue, this PR changes the line to use numpy.round() instead to get the BPM from the returning value.

We could make the fix more elaborate, as beat.beat_track() returns either a float or numpy.ndarray. Librosa docs: beat.beat_track()

To Do

github-actions[bot] commented 1 week ago

Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.