Bastien Nocera wrote:
Would anybody have some code snippet that I could use to get the nominative bitrate of a file, by using the id3_tag ?
Simply put, I don't think this information can be learned from the ID3 tag. Unless (as I suggested) the tag has a TLEN frame -- then you can calculate the average bitrate by dividing the file size (less the size of the ID3 tag) by the playing time indicated by the TLEN frame.
Failing this, you'd have to decode at least one frame of the actual audio using libmad. If the frame contains a Xing VBR header, you can calculate the total playing time and average bitrate very quickly. Otherwise you can either assume the file has a constant bitrate or you can scan the frame headers of the entire file to be more precise. A benefit of the latter option is you can then authoritatively add a TLEN frame to the ID3 tag. :-)