简体   繁体   English

如何知道 mp3 文件的位深?

[英]How to know the bit depth of a mp3 file?

A MP3 file header only contain the sample rate and bit rate, so the decoder can't figure out the bit depth from the header. MP3 文件头仅包含采样率和比特率,因此解码器无法从头中计算出位深度。 Maybe it can only guess from the bit rate?也许它只能从比特率中猜测? But the bit rate is varying from frame to frame.但是比特率因帧而异。

Here is another way to ask this question: If I encoder an 24 bit WAV to mp3, so how does the 24-bit info stored in this mp3?这是问这个问题的另一种方式:如果我将 24 位 WAV 编码为 mp3,那么 24 位信息如何存储在这个 mp3 中?

When the source WAV is compressed, the original bit depth information is "thrown away".当源 WAV 被压缩时,原始位深信息被“丢弃”。 This is by design in any compressed audio codec since the whole point is to use the least bits possible to store the "same" audio.这是在任何压缩音频编解码器中设计的,因为重点是使用尽可能少的位来存储“相同”的音频。

Internally, MP3 uses Huffman symbols to store the processed audio data.在内部,MP3 使用霍夫曼符号来存储处理后的音频数据。 As such, there's no real "bit depth" to report.因此,没有真正的“位深度”要报告。

During the encoding process, the samples are quantized, so the original bit depth information is lost.在编码过程中,样本被量化,因此丢失了原始位深信息。

MP3 decoders either choose a bitdepth they operate at, or allow the end-user/application to dictate it. MP3 解码器要么选择他们操作的位深度,要么允许最终用户/应用程序指定它。 The bitdepth is determined during "re-quantization".位深度是在“重新量化”期间确定的。

Have a read of http://blog.bjrn.se/2008/10/lets-build-mp3-decoder.html which is rather enlightening阅读http://blog.bjrn.se/2008/10/lets-build-mp3-decoder.html很有启发性

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM