Platform SDK: DirectX

IDirectSound::SetSpeakerConfig

The IDirectSound::SetSpeakerConfig method specifies the speaker configuration of the DirectSound object.

HRESULT SetSpeakerConfig(
  DWORD dwSpeakerConfig  
);

Parameters

dwSpeakerConfig
Speaker configuration of the specified DirectSound object. This parameter can be one of the following values:
DSSPEAKER_HEADPHONE
The speakers are headphones.
DSSPEAKER_MONO
The speakers are monaural.
DSSPEAKER_QUAD
The speakers are quadraphonic.
DSSPEAKER_STEREO
The speakers are stereo (default value).
DSSPEAKER_SURROUND
The speakers are surround sound.
DSSPEAKER_STEREO may be combined with one of the following values:
DSSPEAKER_GEOMETRY_WIDE
The speakers are directed over an arc of 20 degrees.
DSSPEAKER_GEOMETRY_NARROW
The speakers are directed over an arc of 10 degrees.
DSSPEAKER_GEOMETRY_MIN
The speakers are directed over an arc of 5 degrees.
DSSPEAKER_GEOMETRY_MAX
The speakers are directed over an arc of 180 degrees.

Return Values

If the method succeeds, the return value is DS_OK.

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

DSERR_INVALIDPARAM
DSERR_UNINITIALIZED

Remarks

If a geometry value is to be used, it must be packed in a DWORD along with the DSSPEAKER_STEREO flag. This can be done by using the DSSPEAKER_COMBINED macro, as in the following C++ example:

lpds->SetSpeakerConfig(DSSPEAKER_COMBINED(
    DSSPEAKER_STEREO, DSSPEAKER_GEOMETRY_WIDE));

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dsound.h.
  Import Library: Use dsound.lib.

See Also

IDirectSound::GetSpeakerConfig, Speaker Configuration