Formula from mp3 Frame Length

╄→尐↘猪︶ㄣ 提交于 2021-01-29 08:50:51

问题


I am working on an mp3 decoder, the formula to determine the length, in bytes, of an mp3 frame is

FrameSize = 144 * BitRate / (SampleRate + Padding)

I can't find anywhere that explains what the '144' represents.

Does anyone know?


回答1:


The 144 represents total bytes-per-frame.

  • MP3 files are generally encoded as MPEG-1 Layer 3.

  • There are 1152 samples per frame in type Layer 3.

  • 1152 samples / 8 bits-per-byte = 144 bytes total.

Taking the formula for frame size (in bytes):

FrameSize = 144 * BitRate / (SampleRate + Padding)

We can see (for MP3 with 192 bitrate @ 44.1 khz):

144 * 192 / (44.1 + 0) = 626 bytes per audio frame (fraction parts are ignored).



来源:https://stackoverflow.com/questions/57103676/formula-from-mp3-frame-length

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!