简体   繁体   中英

Wave to alaw using NAudio?

Hello guys i'm trying to convert wave file to al is there any person familiar with NAudio?

        WaveStream ws = new WaveFileReader(waveFile);
        WaveFormatConversionStream stream =  new WaveFormatConversionStream(WaveFormat.CreateALawFormat(11025,1), ws);
        WaveFileWriter.CreateWaveFile(outputFile, stream);

I was trying this one but acm shows error {"AcmNotPossible calling acmStreamOpen"}

You can't always perform conversions like this in a single step. For example if your input audio is 44.1kHz stereo, then you need to first go to mono, then downsample to 11.025kHz, then you can do the mu law. Check my article here for further explanation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM