Microsoft DirectX 8.1 (C++)

Creating the DirectSoundCapture Object

Create the DirectSoundCapture object by calling the DirectSoundCaptureCreate8 or DirectSoundFullDuplexCreate8 function. Both these functions retrieve a pointer to the IDirectSoundCapture8 interface.

The lpcGUID parameter to DirectSoundCaptureCreate, or the pcGuidRenderDevice parameter to DirectSoundFullDuplexCreate8, can be a GUID obtained by enumeration, or it can be one of the following predefined GUIDs:

DSDEVID_DefaultCapture

The default system capture device. You can also specify this device by passing a NULL pointer in the device GUID parameter.

DSDEVID_DefaultVoiceCapture

The default voice communications capture device. Typically, this is a secondary device such as a USB headset with microphone.

If no device driver is present, the call fails.

You can also use the CoCreateInstance function to create the object. The procedure is similar to that for the DirectSound object; see Creating the DirectSound Object. If you use CoCreateInstance, then the object is created for the default capture device selected by the user in Control Panel.

If you want DirectSound and DirectSoundCapture objects to coexist, then you should create and initialize the DirectSound object before creating and initializing the DirectSoundCapture object, or use DirectSoundFullDuplexCreate8.

Some audio devices aren't configured for full duplex audio by default. If your application has problems with creating and initializing both a DirectSound object and a DirectSoundCapture object, you should advise the user to check the audio device properties to ensure that full duplex is enabled.