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?
相关问题
- Can we recover audio from MFCC coefficients?
- Is there a way to play audio on a mobile browser w
- Is it possible to know the duration of an MP3 befo
- Check if a string is build out of the same letters
- Draw waveform from MP3 stream in C# on WinRT
相关文章
- Android Visualizer class throwing runtime exceptio
- How can I get the BPM property of an MP3 file in a
- c++ mp3 library [closed]
- Simulate Microphone (virtual mic)
- Android Studio Mediaplayer how to fade in and out
- Detect or Approximate Bluetooth Latency on Android
- How to play a specific frequency with Javascript?
- Failed to load because no supported source was fou
It looks like Chromaprint would do what you're looking for. It transforms PCM data in audio fingerprints which you can then use to compare.
They have a C API library (it's actually written in C++, though), a python front end, and also some utilities to convert the results in JSON which means you could use another language to manipulate the data. I don't think that they provide the compare function itself, though.
Also if you're using a Linux system, it's likely that you will find a package for it.
I had the same question. I found that itunes had altered many of my Amazon MP3 downloads, changing the time/date stamps, the file sizes and therefore the MD5 signatures. My backups suddenly had many near duplicate files.
When I did a VIM diff, I could see that the changes were limited to very small parts of the files. The files looked identical side by side in Audacity even at a close zoom.
My solution is to create a headerless WAV dump of the mp3 and then compare the MD5 signatures of each WAV. FFMPEG can do the translation quite easily.
I created a hash with MD5 as key pointing to the original MP3 file spec. Put the wav file on an SSD for speed.
Brute force, but it works.
I frequently use fdupes on linux to locate duplicate files. fdupes uses md5 checksums.
To answer your question better I think we need to know exactly what you are looking to do.
If you are looking to compare the actual song, musicDNS have a library that are able to create audio fingerprints. The library called libOFA can be found here. This fingerprinting system is used by for example musicbrainz to match digital audiofiles to their database. In theory you can use this to compare two different digital files.
If you are looking to compare tag data (id3v1/id3v2) there are a lot of libraries that can do that for you, taglib is mentioned and also libmpg123 have their own functions to extract tag data.
The good thing about the libOFA approach is that you can compare different formats to each other since the fingerprinting is done on the audio itself.
If you're just looking to compare mp3s based on the tags, I'd recommend taglib.
I wrote my master's thesis on audio fingerprinting. The thesis lists a few open source solutions to the problem of comparing what the music sounds like, and provides performance comparisons between them. Might be overkill, but there are some really decent applications out there.
If you only want to compare by tagged data, the standard to look into is ID3. There are basically two versions, the first is very simple (ID3v1) and consists of a 128 byte block at the end of an MP3. ID3v2 puts a larger, variable sized block at the beginning of the MP3.