Microsoft DirectX 9.0

DirectSoundCreate8

The DirectSoundCreate8 function creates and initializes an object that supports the IDirectSound8 interface.

Syntax

HRESULT WINAPI DirectSoundCreate8(
  LPCGUID  lpcGuidDevice,   
  LPDIRECTSOUND8 * ppDS8,  
  LPUNKNOWN  pUnkOuter  
);

Parameters

lpcGuidDevice

Address of the GUID that identifies the sound device. The value of this parameter must be one of the GUIDs returned by DirectSoundEnumerate, or NULL for the default device, or one of the following values.

Value Description
DSDEVID_DefaultPlayback System-wide default audio playback device. Equivalent to NULL.
DSDEVID_DefaultVoicePlayback Default voice playback device.

ppDS8

Address of a variable to receive an IDirectSound8 interface pointer.

pUnkOuter

Address of the controlling object's IUnknown interface for COM aggregation. Must be NULL, because aggregation is not supported.

Return Values

If the function succeeds, it returns DS_OK. If it fails, the return value may be one of the following.

Return code
DSERR_ALLOCATED
DSERR_INVALIDPARAM
DSERR_NOAGGREGATION
DSERR_NODRIVER
DSERR_OUTOFMEMORY

Remarks

The application must call the IDirectSound8::SetCooperativeLevel method immediately after creating a device object.

Requirements

  Header: Declared in Dsound.h.
  Import Library: Use Dsound.lib.

See Also