Pergunta

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?

Foi útil?

Solução

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);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top