1

我正在浏览 NAudio Source Demo 中的 Mp3StreamingDemo,我需要一个关于解压缩 Mp3 帧的解释(没有什么深入的,只是几句话,以获得一个大致的概念)。

实际代码是:

IMp3FrameDecompressor decompressor = null;
//...
if (decompressor == null)
{

    WaveFormat waveFormat = new Mp3WaveFormat(frame.SampleRate, frame.ChannelMode == ChannelMode.Mono ? 1 : 2, frame.FrameLength, frame.BitRate);
    //What does AcmMp3FrameDecompressor do?
    decompressor = new AcmMp3FrameDecompressor(waveFormat);
    this.bufferedWaveProvider = new BufferedWaveProvider(decompressor.OutputFormat);
}
int decompressed = decompressor.DecompressFrame(frame, buffer, 0);

我确实对MP3有一些了解,它看起来如何,关于帧等。我只是不明白mp3帧解压缩的过程?具体来说:

AcmMp3FrameDecompressor 类用于什么?DecompressFrame 方法有什么作用?

我可以从课堂上看到代码,但要深入理解它,我认为我需要更多关于音频本身的知识。目前,正如我所说,我希望只是一般性的描述。

感谢您的时间和帮助。

4

1 回答 1

3

AcmMp3FrameDecompressor 使用计算机上的 ACM 编解码器将 MP3 帧解压缩为 PCM。自 Windows XP 以来的所有 Windows 桌面版本都附带一个,但在某些情况下您可能会遇到一个不可用的情况。NAudio 还提供基于 DMO 的 MP3 帧解码器,可用于 Windows Vista 和更新版本。

于 2013-06-09T20:45:06.417 回答