programmatically get BPM of a wave or MP3 from .Ne

2019-02-13 07:53发布

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?

3条回答
姐就是有狂的资本
2楼-- · 2019-02-13 08:11

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.

查看更多
劳资没心,怎么记你
3楼-- · 2019-02-13 08:15

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

查看更多
beautiful°
4楼-- · 2019-02-13 08:22

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.

查看更多
登录 后发表回答