I want to change the WAV file to 8 kHz and 8 bits using NAudio.
WaveFormat format1 = new WaveFormat(8000, 8, 1); byte[] waveByte = HelperClass.ReadFully(File.OpenRead(wavFile)); Wave using (WaveFileWriter writer = new WaveFileWriter(outputFile, format1)) { writer.WriteData(waveByte, 0, waveByte.Length); }
but when I play the output file, the sound only hiss. Is my code correct or what is wrong?
If you install WaveFormat in WaveFormat (44100, 16, 1), it works fine.
Thanks.
source share