Help - Search - Members - Calendar
Full Version: MP3 frames in an MP3 file
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
hentaisan
I'm trying to understand what comprises an MP3 file, and I have a few questions. I read through this document:
http://www.mp3-tech.org/programmer/frame_header.html

Basically, an MP3 file is split up into frames, each frame containing a 32 bit header. After the header, is the body of the mp3 frame.

1. Firstly and most importantly, my question is, I want to find out how long each frame goes for and when the next one starts - how do you find out how long the body of the frame is? frames may be of different lengths if it is vbr encoded. Can you calculate it from the bit rate field?

2. What is an MP3 frame when it's decoded into raw? Does each frame play for a finite period of time?

3. I read that an MP3 file has no headers - only each frame. What about tags - song name, etc? Are they appended to the MP3 files?

Thank you very much in advance for your help.
Pesmontis
QUOTE (hentaisan @ Aug 14 2007, 02:07) *
1. Can you calculate it from the bit rate field?

Yes: # bytes in frame = 144 * bitrate / sample-rate + value of padding bit (MPEG-1 l. III, aka. 'mp3')
So you need the bitrate, the sample frequency and the pad-flag, which are all in the header;

QUOTE (hentaisan @ Aug 14 2007, 02:07) *
2. What is an MP3 frame when it's decoded into raw? Does each frame play for a finite period of time?

Yes, see this topic: http://www.hydrogenaudio.org/forums/index....showtopic=52525

QUOTE (hentaisan @ Aug 14 2007, 02:07) *
3. Are they appended to the MP3 files?

Yes, exactly so.
pdq
QUOTE (hentaisan @ Aug 14 2007, 04:07) *
3. I read that an MP3 file has no headers - only each frame. What about tags - song name, etc? Are they appended to the MP3 files?

Tags can either be at the front or the back of the file.
hentaisan
QUOTE (pdq @ Aug 14 2007, 20:55) *
QUOTE (hentaisan @ Aug 14 2007, 04:07) *

3. I read that an MP3 file has no headers - only each frame. What about tags - song name, etc? Are they appended to the MP3 files?

Tags can either be at the front or the back of the file.

how do you find out?

i want to break an mp3 down into each individual frame for streaming
pdq
ID3V1 tags go at the end of the file and ID3V2 tags go at the beginning.
Sunhillow
QUOTE (hentaisan @ Aug 14 2007, 17:38) *
QUOTE (pdq @ Aug 14 2007, 20:55) *

QUOTE (hentaisan @ Aug 14 2007, 04:07) *

3. I read that an MP3 file has no headers - only each frame. What about tags - song name, etc? Are they appended to the MP3 files?

Tags can either be at the front or the back of the file.

how do you find out?


everything at the start of the file until the first valid mp3 header + frame body must not be decoded by the decoder. This may be regarded as any kind of header
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.