0

I'm recording in NAudio with a PS3Eye camera, using CLEye drivers. The camera has a 4 microphone array, and presents 4 channels of audio to the system.

By default, all of the channels are being recorded by NAudio. I'm recording to PCM wave, and getting a 4-channel WAV output file.

When I try to play the file in NAudio, I receive an MmException 'NoDriver' calling acmFormatSuggest. Stereo files play fine.

My sound card can only output 2 channels, which appears to cause the error. Setting my Windows audio settings to Quadraphonic does not resolve this issue.

Perhaps I can ask NAudio to record only 2 channels, or implement my own WaveStream somewhere?

Does anybody have any ideas for down-sampling the number of channels in NAudio? (preferably at record time). Big thanks!

Elliot Woods
  • 834
  • 11
  • 20
  • This seems to be related to what I need [link](http://stackoverflow.com/questions/6962312/how-to-use-naudio-to-join-3-wav-files-into-single-file-with-3-channels-in-c). – Elliot Woods Aug 26 '11 at 18:37
  • so i've made a class that inherits from WaveStream and performs the downsampling based on code from StereoToMonoProvider16. Not working yet, just need to figure out how to implement properly (my play/stop controls are broken now, plays automatically, and no sound coming out, but Position reports correctly) – Elliot Woods Aug 26 '11 at 18:40

1 Answers1

0

isn't it as simple as declaring it in your WaveFormat? 12000 is the sample rate and "1" is the number of channels.

 waveInStream = new WaveIn(WaveCallbackInfo.FunctionCallback());
 waveInStream.WaveFormat = new WaveFormat(12000, 1);
 waveInStream.DeviceNumber = 2;

 AudioWriter = new WaveFileWriter("c:\\MyAudio.wav", waveInStream.WaveFormat);
 waveInStream.DataAvailable += waveInStream_DataAvailable;
 waveInStream.StartRecording();

thats how i setup my code for a basic webcam recorder and with stereo mics it outputs mono wav files.

Lee Harrison
  • 2,306
  • 21
  • 32
  • Results in an exception on StartRecording(), but i'm using WasapiCapture, and the exception occurs within WasapiCapture – Elliot Woods Aug 27 '11 at 07:04
  • If I use WaveIn rather than WasapiCapture, I get 1 channel by default anyway with the quad mic's, which is definitely useful! – Elliot Woods Aug 27 '11 at 07:24