Microsoft DirectX 9.0

System Property Sets

Information about system-wide DirectSound device properties can be obtained from an object of class CLSID_DirectSoundPrivate (11AB3EC0-25EC-11d1-A4D8-00C04FC28ACA). This class supports the IKsPropertySet interface. The CLSID and properties are defined in Dsconf.h.

  1. To create an object of this classCall the LoadLibrary function to load Dsound.dll.
  2. Call the GetProcAddress function to obtain the DllGetClassObject function.
  3. Call DllGetClassObject to obtain the IClassFactory interface of the class factory for the CLSID_DirectSoundPrivate class.
  4. Call IClassFactory::CreateInstance to create the CLSID_DirectSoundPrivate object and retrieve the IKsPropertySet interface (IID_IKsPropertySet).

The CLSID_DirectSoundPrivate object supports one property set, DSPROPSETID_DirectSoundDevice (84624F82-25EC-11d1-A4D8-00C04FC28ACA). This property set exposes the following three read-only properties.

DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING

This property retrieves the DirectSound device GUID corresponding to a specified Windows Multimedia device name.

Property data is contained in a DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_DATA structure, available in ANSI and Unicode versions. This structure has the following members.

Member Type Description
DeviceName String [in] Name of device
DataFlow DIRECTSOUNDDEVICE_DATAFLOW [in] Direction of data flow, either DIRECTSOUNDDEVICE_DATAFLOW_RENDER or DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
DeviceID GUID [out] DirectSound device ID

DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION

This property retrieves a full description of a DirectSound device specified by GUID.

Property data is contained in a DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA structure, available in ANSI and Unicode versions. This structure has the following members.

Member Type Description
Type DIRECTSOUNDDEVICE_TYPE [out] Device type: DIRECTSOUNDDEVICE_TYPE_EMULATED, DIRECTSOUNDDEVICE_TYPE_VXD or DIRECTSOUNDDEVICE_TYPE_WDM
DataFlow DIRECTSOUNDDEVICE_DATAFLOW [in, out] Direction of data flow, either DIRECTSOUNDDEVICE_DATAFLOW_RENDER or DIRECTSOUNDDEVICE_DATAFLOW_CAPTURE
DeviceID GUID [in] DirectSound device GUID, or NULL for the default device of the type specified by DataFlow
Description String [out] Description of DirectSound device
Module String [out] Module name of the DirectSound driver
Interface String [out] PnP device interface name
WaveDeviceID ULONG [out] Identifier of the corresponding Windows Multimedia device

DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE

This property enumerates all DirectSound render or capture devices.

Property data is contained in a DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_DATA structure, available in Ansi and Unicode versions. This structure has the following members.

Member Type Description
Callback LPFNDIRECTSOUNDDEVICEENUMERATECALLBACK [in] Application-defined callback function. When IKsPropertySet::Get is called, this function is called once for each device enumerated. It takes as parameters a DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_DATA structure describing the enumerated device, and the value in Context.
Context LPVOID [in] User-defined value to be passed to the callback function for each device enumerated.