简体   繁体   English

使用 NAudio 向 alaw 挥手?

[英]Wave to alaw using NAudio?

Hello guys i'm trying to convert wave file to al is there any person familiar with NAudio?大家好,我正在尝试将波形文件转换为 al 有熟悉 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"}我正在尝试这个,但 acm 显示错误 {"AcmNotPossible 调用 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.比如你的输入音频是44.1kHz立体声,那么你需要先去单声道,然后下采样到11.025kHz,然后就可以做mu法则了。 Check my article here for further explanation. 在这里查看我的文章以获得进一步的解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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