Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shilpakas opened this issue Aug 14, 2020 · 4 comments

Comments

@shilpakas
Copy link

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);
}

@markheath
Copy link
Contributor

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

@shilpakas
Copy link
Author

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

@markheath
Copy link
Contributor

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

@shilpakas
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants