Skip to content Skip to sidebar Skip to footer

Detecting Bpm Of Audio Input Using Javascript?

I'm trying to put together an audio input + beatdetektor example so I could calculate the BPM of a track playing through my line in ( or even microphone input ). Unfortunately, I d

Solution 1:

According to the documentation on the BeatDetektor library, the process() function takes an argument in seconds.

My guess would be that the argument is the seconds since the start of the song, not an absolute date. Right now you're passing in the number of milliseconds since 1970. I don't know of any songs that are that long.

Here is an example of using the process() function to simulate 30 seconds of a song.

It looks like you're going to have to keep track of the start time of the song, then calculate how much time has passed when calling the process() function. Processing has a handy millis() function that might help you out.


Post a Comment for "Detecting Bpm Of Audio Input Using Javascript?"