Microsoft DirectX 8.0 (C++)

DirectSoundCreate8

Creates and initializes an object that supports the IDirectSound8 interface.

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, NULL for the default device, or one of the following values:
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, the return value is DS_OK.

If the function fails, the return value may be one of the following error values:

DSERR_ALLOCATED
DSERR_INVALIDPARAM
DSERR_NOAGGREGATION
DSERR_NODRIVER
DSERR_OUTOFMEMORY

Remarks

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

Requirements

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

See Also

IDirectSound8::GetCaps, IDirectSound8::SetCooperativeLevel