I am currently using getID3() to read mp3 tag data such as artist name, filesize, duration etc. All of this happens on the fly when a user uploads a file to my site.
However I would like to automatically detect the tempo in bpm of each song in order to save it to my database.
So in a nutshell I am looking for either a command line utility that can be run from a centOS server or a php based script that will take an mp3 or wav file, analyze it and return the tempo as bpm.
I have found soundstretch but which can apparently do just that but for some reasons seem unable to get it installed.
Does anyone have any ideas?
EDIT: I have finally managed to successfully install soundtouch/soundstretch.
I would like to call them dynamically from within my php upload script so that the return bpm value can be added to the database.
I have tried to following with no success...
$bpm = exec("soundstretch $filename -bpm");
assuming that the variable $bpm would now contain the bpm. I must be misunderstanding how soundtouch works. unfortunately the documentation is minimal.
How would I go about collecting the returned bpm and storing it as a variable in order to save it into my database.