Platform SDK: DirectX

Creating the DirectSoundCapture Object

[C++]

Create the DirectSoundCapture object by calling the DirectSoundCaptureCreate function, which returns a pointer to an IDirectSoundCapture interface.

The lpGUID parameter to DirectSoundCaptureCreate can be a GUID obtained by enumeration, or it can be NULL for the preferred capture device. In most cases, you will pass NULL.

You can also use the CoCreateInstance function to create the object. The procedure is similar to that for the DirectSound object. For more information, see Creating the DirectSound Object. If you use CoCreateInstance, the object is created for the default capture device selected by the user on the multimedia control panel.

If you want DirectSound and DirectSoundCapture objects to coexist, create and initialize the DirectSound object before creating and initializing the DirectSoundCapture object.

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.

[Visual Basic]

You create the DirectSoundCapture object by calling the DirectX7.DirectSoundCaptureCreate method, which returns a DirectSoundCapture object.

The guid parameter to DirectSoundCaptureCreate can be a GUID obtained by enumeration, or it can be an empty string for the preferred capture device. In most cases you will pass an empty string.

If you want DirectSound and DirectSoundCapture objects to coexist, create the DirectSound object before creating the DirectSoundCapture object.

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.