Open majiabin opened 5 months ago
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)
using (WaveFileReader reader = new WaveFileReader(infile)) { MediaFoundationEncoder.EncodeToMp3(reader, mp3FilePath);
}