简体   繁体   中英

How to convert WAV stream to MP3 using Naudio?

I've seen a sample in Naudio documentation that it converts the MP3 stream to WAV stream. My doubt is, does Naudio do it in reverse? That is, can it convert a WAV stream to MP3 stream? If yes, please explain how or help me with some references.

NAudio does not come with an MP3 encoder or decoder - it simply gives you access to the codecs that are already installed on your system. Until Windows 8, Windows did not ship with an MP3 encoder, so your best option was to convert to WAV using something like LAME.exe . I explain how you can do this on the fly towards the end of this article .

In Windows 8, there is an MP3 encoder, which you access with the new MediaFoundationEncoder.EncodeToMp3 function. This is currently pre-release for NAudio v1.7, but you can try it out by getting the latest build from nuget .

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