This project has moved. For the latest updates, please go here.

WasapiCapture exclusive AudioClient mode

Oct 11, 2009 at 5:25 PM

Hi,

playing around with the Wasapi I noticed that it is not possible to use all WaveFormats. For example the 8kHz, 16bit, 1 Channel gives me the "format not supported exception". After looking at the code I saw this is due to the initialization of the AudioClient with the shard mode:

audioClient.Initialize(AudioClientShareMode.Shared,

So my question is if there is a workaround  so that I can use whatever format I need beside the ones allowed in the shared mode?

thanks,

Chris

Coordinator
Oct 12, 2009 at 2:30 PM

Hi Chris,

I'm afraid this is a limitation of WASAPI, and a real shame that MS didn't put in their own sample rate conversion. You end up being forced to use your own sample rate conversion, or more simply use WaveOut or DirectSoundOut, which handle this for you.

Mark

Aug 9, 2010 at 8:27 PM
Edited Aug 9, 2010 at 8:27 PM

Hi there,

First of all, NAudio is a fine piece of software, thanks for it :-)

Having the same problem (in windows 7), want to capture audio via wasapi in exclusive mode, because I need to override the default 1 channel 44100 16bit capture mode win7 uses for shared mode capture when plugging in a usb audio device.

Is there a specific reason why shared mode is hardcoded in wasapicapture, while in wasapiout I can specify the desired mode in the constructor?

Thanks in advance for your help,

Florian

Coordinator
Sep 6, 2010 at 3:12 PM

hi, I didn't write the WASAPI capture myself, so I can't say for sure. Why not make a modification to the NAudio code and see if it works in exclusive mode. If so, we can put an option on the constructor

Mark