我使用此代码重新采样文件并保存它,但文件听起来像快进录音:
using (MediaFoundationReader reader = new MediaFoundationReader(url))
{
using (ResamplerDmoStream resampledReader = new ResamplerDmoStream(reader, new WaveFormat(16000, 16, 1)))
{
using (WaveFileWriter waveWriter = new WaveFileWriter(@"c:\test.wav", resampledReader.WaveFormat))
{
resampledReader.CopyTo(waveWriter);
}
}
}