adamjakab / BeetsPluginBpmAnalyser

A beets plugin for obsessive-compulsive music geeks to add BPM information to their songs.
MIT License
23 stars 4 forks source link

0 bpm detected #4

Closed andrewjw closed 4 years ago

andrewjw commented 4 years ago

When running bpmanalyser all files are detected as having a bpm of 0.

andrew@tv:~/temp_music$ beet bpmanalyser --dry-run artist:Foals
bpmanalyser: Song[/mnt/nfs/music_hq/Foals/Antidotes/02 Cassius.flac] bpm: 0

Is there any way I can debug this? Running aubio manually works...

andrew@tv:~$ aubio tempo /mnt/nfs/music_hq/Foals/Antidotes/02\ Cassius.flac
148.67 bpm

Initially aubio didn't work because I didn't have the right libraries installed to enable flac files. I've corrected that, but the beet plugin still doesn't work.

andrewjw commented 4 years ago

I worked out what the problem is - I'm running the script in Python 3.6, using python3 as the command. python points to Python 2, which doesn't have aubio installed so the external script crashes. By hacking the plugin to call the external script with python3 it works.

adamjakab commented 4 years ago

Hi @andrewjw! Good catch! I am trying to find a way not to use the external script however aubio sometimes throws warnings and errors that I don't know how to "silence" unless it runs as an external process. You are welcome to make suggestions to the code.

So everything is working for you now? I have not tested audio files other than mp3. Is it working well with flac format?

andrewjw commented 4 years ago

I have created a simple pull request which uses the same version of Python as is being used in beets. Personally I would be ok with the errors and warnings. Tracking down why it was returning 0 was tricky because all the errors were suppressed.

Once I installed the libavcodec development packages and reinstalled aubio flac files appear to work well. I've not verified the numbers are correct, but they certainly seem sensible.