== How is MP3 built? ==
<
>
||Most people with a little knowledge in MP3 files know that the sound is divided into smaller parts and compressed with a psycoacoustic model. This smaller pieces of the audio is then put into something called 'frames', which is a little datablock with a header. I'll focus on that header in this text.<
><
>The header is 4 bytes, 32 bits, big and begins with something called sync. This sync is, at least according to the MPEG standard, 12 set bits in a row. Some add-on standards made later uses 11 set bits and one cleared bit. The sync is directly followed by a ID bit, indicating if the file is a MPEG-1 och MPEG-2 file. 0=MPEG-2 and 1=MPEG-1 || {{attachment:mp3frame_blocks.gif}} ||
The layer is defined with the two layers bits. They are oddly defined as <
>
|| 0 0 || Not defined ||
||0 1 || Layer III ||
||1 0 || Layer II ||
||1 1 || Layer I ||
With this information and the information in the bitrate field we can determine the bitrate of the audio (in kbit/s) according to this table.
||''' Bitrate<
>value ''' ||''' MPEG-1,<
>layer I ''' ||''' MPEG-1,<
>layer II ''' ||''' MPEG-1,<
>layer III ''' ||''' MPEG-2,<
>layer I ''' ||''' MPEG-2,<
>layer II ''' ||''' MPEG-2,<
>layer III ''' ||
|| 0 0 0 0 ||||||||||||