naudio / NAudio.WaveFormRenderer

Simple utility to render waveforms of audio files in various styles using System.Drawing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

: Wav to ulaw convert is not working output file is getting sizzling sound

shilpakas opened this issue · comments

using (WaveFileReader reader = new WaveFileReader(inputWav))
var s = new RawSourceWaveStream(new MemoryStream(), new WaveFormat(8000, 16, 1));
using (var conversionStream = new WaveFormatConversionStream(newFormat, reader))
using (var convStream2 = new WaveFormatConversionStream(mulaw, conversionStream))
{
WaveFileWriter.CreateWaveFile(outputWav, convStream2);
// File.WriteAllBytes("voiceprompt_raw.wav", decoded);
}

what is the format of the input wav file?
What are the values of "newFormat" and "mulaw"?
Try saving a WAV file after the first conversion stage to narrow down where the issue is

Thanks. it is .wav of 41KHZ and convert to g.711 format

OK so first you must downsample to 8kHz (and stereo to mono). Then you can go to mu-law. This article explains more about multi-stage conversions

Sorry forgot to mention in above the file is in ADPCM
it is in compression state