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?
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
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
I frequently use fdupes on linux to locate duplicate files. fdupes uses md5 checksums.
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.
If you're just looking to compare mp3s based on the tags, I'd recommend taglib.
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.