programmatically get BPM of a wave or MP3 from .Ne

2019-02-13 07:33发布

问题:

I have a project with a requirement to get the BPM of a wave or MP3 file programmatically using .Net (VB.Net or C#).

Does anyone know of a binary or library for this or have a code snippet to steer me in the right direction?

回答1:

Here's a commercial product that has a C# library. A trial is also available: http://adionsoft.net/bpm/



回答2:

For the part where you get the samples from WAV or MP3 in .NET code, I use NAudio (at CodePlex), free, usable in commercial apps, no real documentation, just sample code.



回答3:

First, if you want to do sound with .Net, I would recommend fmod which is awesome and has a .Net wrapper (http://www.fmod.org).
Next, to get the BPM there are several methods but the one I find the most effective is the "beat spectrum" (described here: http://www.rotorbrain.com/foote/papers/icme2001/icmehtml.htm).
This algorithm computes a similarity matrix by comparing each short sample of the music with every others. Once the similarity matrix is computed it is possible to get average similarity between every samples pairs {S(T);S(T+1)} for each time interval T: this is the beat spectrum. The first high peak in the beat spectrum is most of the time the beat duration. The best part is you can also do things like music structure or rythm analyses.
If you are interested in this field, I would suggest to read other Jonathan Foote papers.