HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: RealityRipple on 2009-05-27 09:29:59

Title: Xing/Info and VBRI Tag specs
Post by: RealityRipple on 2009-05-27 09:29:59
I've been working on a media player for quite some time, using DirectShow for the convenience of programming and a wide range of compatible formats through .ax codecs. Recently, I've been redoing how I handle MP3 files, and parsing most of the display info myself. Currently, I've done the whole ID3 thing (headache city), MPEG tags (genius to have them only 4 bytes!), and more recently, Variable BitRate headers in order to determine the BitRate and duration accurately. My current information on this last subject has been from this CodeProject page (http://www.codeproject.com/KB/audio-video/mpegaudioinfo.aspx), and the link to this MP3-tech specification page (http://gabriel.mp3-tech.org/mp3infotag.html#versionstring). With them, I've gotten so far as to handle the duration of both Xing and Fraunhofer VBR files (I think). However, many of the links to other data on the Xing specifications are now dead, and there was no extra info on VBRI. Where can I find up-to-date information on these formats, and perhaps some answers to a few questions along the way?

I have a 'small' list of requests:
1) Is there a cleaned-up, up-to-date, full specification on the Xing info tags?
2) Is there a page of specs for Fraunhofer info tags as well?
3) What is the Table of Contents? What's it used for?
4) Looking at the Xing specs, I noticed the replay gain values. Is there a way I can implement a selection somehow, using DirectShow in Visual Basic 6? (Yes, I know it's a dead language, but it's better than VB.NET)
4a) How can I implement the Replay Gain system?
4b) How are the Replay Gain values calculated? It's a DWORD with a +/- bit before it, I understand, but I thought replay gains had more than a single decimal (and is 0 = - and 1 = +?)
5) What's the best way to skip past ID3 tags to the first MPEG frame? The ID3 length value is, to say the least, unreliable, and my current method includes parsing the entire ID3v2 frame, searching for an 0xFF byte, and checking to see if three valid MPEG frames exist in a row when I find one. It requires loading the entire file into memory (in order to load and cut the ID3v2 tag and the ID3v1 tag at the end, as well as to more rapidly search for an MPEG frame), which takes a good 300ms per file. Quite annoying in a playlist of hundreds of songs.
6) Can I get some example MP3 data to test out parsing of various headers and tags? I can't find any Fraunhofer files on my entire computer of over ten thousand songs.

Thank you guys for reading, and hopefully thanks for the information. If anyone would like to see my code (I've got it all in a nice ActiveX DLL), I can upload it now/when it's complete for public use and modification.
Title: Xing/Info and VBRI Tag specs
Post by: RealityRipple on 2009-05-28 00:01:50
Also, I found a file I have that claims to use Full VBR Method 14, but so far as I knew, only 1-6, 8, and 9 were set values. Are there more?