Hello -
I hope this question doesn't fall outside this list's domain, but I figure there's probably a ton of mp3 know-how in this group... :)
Anyway, I was looking at the mp3 headers from a file, and my calculation of the frame length appears to be wrong, but I can't figure out why. The first frame of the file looks like this:
ff f3 68 64
which tells me that this is a 48kbps MPEG2 Layer-3 file at 16000Hz in joint-stereo, which is true based on what madplay says. I'd like to calculate the frame size based on this info, and using this equation for Layer-III files from http://www.dv.co.yu/mpgscript/mpeghdr.htm -
FrameLengthInBytes = 144 * BitRate / SampleRate + Padding
I calculate that the frame size is 432 bytes. When I scan through the file given this information, I find a total of 1924 frames. When madplay scans through the file, though, it finds twice as many, 3848 frames. So it seems that my frame length is 2x too big. Why does this equation hold for my 128kbps version of the same file, but not for this version (or am I missing something obvious)?
On that note, does anyone have any suggestions for an mp3 frame-related resource? The one I mentioned above seems decent, but if there are any better ones, I'd love to know...
Thanks for any help, Haig