Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用C将WAV PCM压缩到Microsoft GSM 6.10音频编解码器#_C#_Gsm_Pcm - Fatal编程技术网

C# 使用C将WAV PCM压缩到Microsoft GSM 6.10音频编解码器#

C# 使用C将WAV PCM压缩到Microsoft GSM 6.10音频编解码器#,c#,gsm,pcm,C#,Gsm,Pcm,有人知道如何将PCM格式的未压缩波形文件转换为GSM 6.10音频编解码器中压缩的wav文件吗?IIRC,如果您安装了编解码器,应该能够使用波形转换流进行编码 谢谢你,我现在有一张支持票,因为我在那里做这个软件时遇到了一个问题。我正在寻找不同于naudio的方式,因为我面临着实现这一目标的压力。让我们知道,除了这个问题,它是一个创建库。 static void ToWavWithGsm() { string fileName = @"e:\Down\male.wa

有人知道如何将PCM格式的未压缩波形文件转换为GSM 6.10音频编解码器中压缩的wav文件吗?

IIRC,如果您安装了编解码器,应该能够使用
波形转换流进行编码


谢谢你,我现在有一张支持票,因为我在那里做这个软件时遇到了一个问题。我正在寻找不同于naudio的方式,因为我面临着实现这一目标的压力。让我们知道,除了这个问题,它是一个创建库。
    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();
    }