NAudio icon indicating copy to clipboard operation
NAudio copied to clipboard

Encode input format must be PCM or IEEE float

Open majiabin opened this issue 1 year ago • 1 comments
trafficstars

using (WaveFileReader reader = new WaveFileReader(infile)) { MediaFoundationEncoder.EncodeToMp3(reader, mp3FilePath);

}

majiabin avatar Jan 08 '24 16:01 majiabin

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)

markheath avatar Jan 16 '24 15:01 markheath