MP3 Specification

Hi

Does anyone know of any good online resources for describing in detail the way to decode the MP3 file format? I am aware of the 11172-3 ISO specification document, you have to pay for that and I wanted to see if there were other documents / books that explained things in just as much details but were cheaper. I am also aware of some mpeg 1 drafts floating around. They have the first part of the spec in them but are missing all the important appendices.

I’ve done a lot of searching for 11172-3 and mpeg 1 audio but haven’t had much luck (found out there are a lot of scam download site for iso documents though :))

Ziozio

First result if you search: http://www.iso.org/iso/catalogue_detail.htm?csnumber=22412

Do you try to get it for free? Is this why you end up on scam sites? Why not just look into other opensource projects that already implement the codec? Isn’t that this the easiest solution to get an idea how it works? :slight_smile:

Yes I am aware of that site, as I said I am aware of the official specification document. I am not especially looking for a free document, I was just looking for something cheaper. The scam sites looks like ebook sites or try to look genuine at the front before you get taken to dodgy looking pay to download sites and some scam by looking to charge higher than the ISO site for the document. I’ve also looked on Amazon but there isn’t much to go on to really if the small number of books really does have the information.

I’ve looked at open source projects but I would prefer to read something explaining the why’s, I quite like the learning aspect of implementing things too. The ISO document is my solution of last resort, just seeing if people know of other good sources of information

I did a bit of research of MP3 files about a month ago. I decided that the format wasn’t documented properly. I would suggest looking at a raw audio format containing minimalistic data. You said that you looked into MPEG 1, which is a predecessor of MP3. I don’t know much about audio files - or even how the data is stored and loaded. I use wav and LWJGL’s WavData. By raw data, I mean data that isn’t compressed and able to be actually used. I think I remember reading about ‘raw audio’ not being able to be understood. idk.
tl;dr search for an uncompressed minimalistic format and understand it first

My little experiment with XMI files led me to a great distribution joke, and this point: if you want to understand the core of something, you need a MWE before you can start to understand the more advanced features something brings. What turned out as just uncompressed data and width and height turned into a better format for me to utilize - something I can also store image-specific metadata, such as transparency. I understand what the PNG format tried to bring with its data and why it replaced BMP files majorly. I can’t help but to say XMI still loads faster at the cost of HDD space, but now I have a format that can allow the user to choose HDD and less load time, or more load time less HDD space. (with a compressed flag) Just a lot of neat little features. I also did this as an exercise for bit-byte manipulation.
tl;dr distribution of XM files were a joke, have a MWE, understanding all features of a file is good for understanding the usability

That said, I like your goal with actually understanding the file formats features. I would stay away from compatibility and stick with a general, latest version export guideline. Don’t go messing around with different bit rate adjustments support until you have this MWE. You might get caught up in trying to support everything before you can support one thing. There is no need to directly support more than you are using, too.

Good luck! :slight_smile:

Hydroque

Thanks for your reply, MP3 is typically referred to as MPEG1/2 Layer 3. The MPEG 1 specification is quite detailed and mentions 3 different layering techniques (for which MP3 uses the third) to help decode each frame in the MP3 file. The MPEG 2 and MPEG 2.5 specifications are just extensions of MPEG 1.

I already have my own OGG / WAV decoders written from scratch and I am partially through having an OPUS decoder too. I am just keen to get MP3 added to my belt!

It’s great that you know these formats. You know, companies pay big money for new programs because not everyone knows specifications of file formats. The more you know, the more you are worth. I’ve seen a local posting on craigslist looking to pay serious $$$ for adding support for some formats a couple years ago to their program.

I knew MP3 was an extension was relevant to MPEG :point:

Since you know basic level formats I would just be worried about getting that data to be rastered into OpenAL or whatever.

@ziozio I’m impressed you’ve been able to figure out ogg and other formats. I recall trying to figure out OGG/VORBIS several years ago and was unable to get any traction and gave up.

I just went to the wikipedia entry for MP3, and am seeing that the patents expire in 2017 in the USA, but have already expired in the European Union. I’m wondering if there are some European sites that have information, such as an academic site for New Music, like Stanford’s CCRMA.

I tried doing a search at CCRMA for “MP3” and it looks like there have been talks and courses, but I didn’t see any online documentation.
https://ccrma.stanford.edu/search/node/mp3

But I do think there is a big New Music site in Paris, IRCAM.


Might find something poking around there, but it will probably be written in French.

I used to know how to get to lots of great tutorials at CCRMA, on digital music tech and math. The links I had are on a browser on an old PC that I rarely use now. Maybe they’ve made things harder for freeloaders, and want students and income for the information they teach. I remember working through sections that they had explaining the math behind e^i*PI = -1 and briefly being able to hold it in my head. I don’t know if that stuff is still available from them.

Er… not everyone needs to know the specification of formats. Any codec that becomes popular nowadays does so by having good encoder/decoder support for popular languages, as well as proper documentation and specification. MP3 would never have caught on had it been created today. All you need to know now is how to find the encoding/decoig library and use it.

The main problem with using MP3 is that it’s caught up in patents. And to be honest, it isn’t a particularly good format anyway. Better to use an open and non-patent-encumbered format and just convert everything to that.

@philfrei Yes the Ogg / Vorbis was a pain to code up, mainly because the spec isn’t 100% accurate and sometimes the interpretation is a little vague, was pretty happy once it was done though! I was hoping some sites would have more on the mp3 but it looks like they still don;t. Thanks for the links though, I’ll check them out.

e^i*Pi is a fun equation, I did a maths degree at university and we proved this (its not actually that hard once you know a few tricks)

@hydroque everything I have is already coded up for openal and it works fine in my 3d world

@HeroesGrave you are right about mp3 not being a great format its just something on my to do list. Opus is my new targetted format as its meant to be better than vorbis.