简体   繁体   中英

Mp3 frame decompress with NAudio

I am going through Mp3StreamingDemo from NAudio Source Demo, and I need an explanation (nothing in depth, just a few sentences, to get a general idea) about decompressing the Mp3 frame.

The actual code is:

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);

I do have some knowledge about MP3, how does it look, about frames, etc. I just don't understand the process of mp3 frame decompression? Specifically:

what for is AcmMp3FrameDecompressor class used? What does DecompressFrame method do?

I can see the code from the class, but to understand it in depth I think I'll need much more knowledge about audio itself. And at the moment, as I said, I would appreciate just a description in general.

Thank you for your time and help.

AcmMp3FrameDecompressor decompresses an MP3 frame to PCM using the ACM codec on your computer. All desktop versions of Windows since Windows XP come with one, but there are some cases you might encounter where one is unavailable. NAudio also supplies a DMO based MP3 frame decoder, which can be used on Windows Vista and newer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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