有没有人知道如何将PCM格式的未压缩wav文件转换为GSM 6.10 Audio Codec压缩的wav文件?
答案 0 :(得分:2)
尝试How to convert to Gsm Wav file
static void ToWavWithGsm()
{
string fileName = @"e:\Down\male.wav";
WaveReader wr = new WaveReader(File.OpenRead(fileName));
IntPtr format = wr.ReadFormat();
IntPtr formatGsm = AudioCompressionManager.GetCompatibleFormat(format,
AudioCompressionManager.Gsm610FormatTag);
byte[] dataGsm = AudioCompressionManager.ToFormat(wr, formatGsm);
WaveWriter ww = new WaveWriter(File.Create(fileName + ".wav"),
AudioCompressionManager.FormatBytes(formatGsm));
ww.WriteData(dataGsm);
ww.Close();
wr.Close();
}
答案 1 :(得分:0)
IIRC,如果您安装了编解码器,naudio应该可以使用WaveFormatConversionStream
进行编码