Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculating the length of MP3 Frames in milliseconds [closed]

Tags:

c#

.net

audio

mp3

Lets say one MP3 Frame length in bytes is 104: how to get that in milliseconds? Is there any formula or something to do that?

like image 929
Desolator Avatar asked Jun 02 '11 21:06

Desolator


1 Answers

Hmm, it's strange but no one answer the question properly. I've been investigating, here's the formula:

Frame length (in ms) = (samples per frame / sample rate (in hz)) * 1000

The typical MP3 (an MPEG Layer III, version 1) has 1152 samples per frame and the sample rate is (commonly) 44100 hz. So (1152 / 44100) * 1000 = 26,122449 ms per frame.

Notice the frame length (time) does not depend on the bitrate.

More info: http://www.mp3-converter.com/mp3codec/frames.htm

like image 109
lucianolev Avatar answered Oct 20 '22 05:10

lucianolev