NAudio
NAudio copied to clipboard
Encode input format must be PCM or IEEE float
trafficstars
using (WaveFileReader reader = new WaveFileReader(infile)) { MediaFoundationEncoder.EncodeToMp3(reader, mp3FilePath);
}
WAV files sometimes contain compressed audio. Take a look at the WaveFormat of the WaveFileReader, and possibly WaveFormatConversionStream.CreatePcmStream could be used to convert it to PCM (dependent on what codecs are available on your machine)