How to compare mp3 programmatically

2020-02-23 05:34发布

I like to be able to compare mp3’s programmatically. The problem I don’t know by what. Header? Histogram? channels? Does anyone have experience with this subject?

8条回答
Root(大扎)
2楼-- · 2020-02-23 06:10

What do you mean by comparing ? The meta-data (author, title, etc...), the audio data ? For what purpose ?

On popular and basic way to compare audio data is to compute some kind of distance on some spectral features, such as MFCC:

http://en.wikipedia.org/wiki/Mel_frequency_cepstral_coefficient

查看更多
走好不送
3楼-- · 2020-02-23 06:17

I guess there are a number of approaches you could take to this:

1. Compare tags

You could compare the data held in mp3's tags. The tags are held in the ID3 format. There are a number of libraries to help you access the tags, tagLib is a popular choice (TagLib Sharp for .net apps)

2. Acoustic fingerprint

This is by far the most robust method, allowing you to find matches regardless of the compression or even format. A unique fingerprint is created from the actual audio from the file allowing the song to be identified echoprint is an opensource example of this.

3. Creating a hash from the file

This is a quicker method allowing you to find file with content that matches exactly.


Some further reading:

  • There's an interesting MSDN article about managing an mp3 collection (including reading the tags) here: link text (It's in visual basic but might still be useful.)

  • There's a little description of the file format here: link text

查看更多
登录 后发表回答