Help - Search - Members - Calendar
Full Version: MP3 frame length
Hydrogenaudio Forums > Lossy Audio Compression > MP3 > MP3 - Tech
Efcis
Hi

I'm working on various big mp3 files (read several hundreds of MB), on which I extract some small clips (few minutes).

To do so, I need to know the MP3 frame size, and the total duration of the original file.

The MP3 frame headers are currently FF F3 38 C4, meaning MPEG2, Level 3, 24 kbps, 16 kHz sampling, no padding and *mono*. These files are CBR.

From various documentations, I found a formula to get the frame length which says :

FrameLengthInBytes = 144 * BitRate / SampleRate + Padding

Applied to these files, it gives 216 bytes (144 * 24/16), but by examining my file with an hex editor, I can clearly see it is currently 108 bytes only. It also matches the 36 ms duration per frame when I extract clips.

1/ Did I miss something in the calculation ?
2/ Is it related to the monophonic nature of this file ?

Thanks
j7n
MPEG II should be calculated as 72 * Bitrate / Samplerate + Padding.

There are same number of frames per second but with half as much data.
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-2008 Invision Power Services, Inc.