1. NuGet installs NAudio, the URL of the project and demo: https://github.com/naudio/NAudio
Encode to MP3, WMA and AAC with MediaFoundationEncoder
Use MediaFoundationEncoder to encode audio files to MP3, WMA, AAC Demo address:
https://github.com/naudio/NAudio/blob/master/Docs/MediaFoundationEncoder.md
reference namespace
using NAudio.Wave;
string fromFilePath = @"F:\Test\ffmpegTest\ffmpegTest\audio.wav"; string toFilePath = @"F:\Test\ffmpegTest\ffmpegTest\audio.mp3"; using (var reader = new MediaFoundationReader(fromFilePath)) { MediaFoundationEncoder.EncodeToMp3(reader, toFilePath); }