문제

This code works on 32bit Windows XP but on 64bit Windows 7 it raises an exception. (on any CPU configuration)

var format = NAudio.Wave.WaveFormat.CreateCustomFormat(
    WaveFormatEncoding.Pcm, 8000, 1, 16000, 1, 16)
BufferedWaveProvider myBufferedWaveProvider = new BufferedWaveProvider(format);
myWaveOut.Init(myBufferedWaveProvider);

Any help?

도움이 되었습니까?

해결책

You've created an invalid WaveFormat. PCM 8kHz mono 16 bit (which is what you seem to be trying to make) has a block align of 2. There's an easier way to make this WaveFormat in NAudio:

new WaveFormat(8000, 1);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top