Translating Speaker-Configuration Requests

Note  This information applies to Windows XP and earlier operating systems. Starting with Windows Vista, IDirectSound::GetSpeakerConfig and IDirectSound::SetSpeakerConfig have been deprecated.

When an application calls IDirectSound::SetSpeakerConfig (see Microsoft Windows SDK documentation) to change the speaker configuration, DirectSound translates the specified DSSPEAKER_Xxx speaker-configuration parameter to the equivalent KSAUDIO_Xxx channel-configuration mask. It sends a KSPROPERTY_AUDIO_CHANNEL_CONFIG set-property request containing this mask to the filter that represents the DirectSound device.

In the following table, each DSSPEAKER_Xxx parameter on the left is paired with the equivalent KSAUDIO_Xxx channel-configuration mask on the right.

DSSPEAKER Parameter KSAUDIO Channel-Configuration Mask

DSSPEAKER_DIRECTOUT

KSAUDIO_SPEAKER_DIRECTOUT

DSSPEAKER_HEADPHONE

KSAUDIO_SPEAKER_STEREO

DSSPEAKER_MONO

KSAUDIO_SPEAKER_MONO

DSSPEAKER_STEREO

KSAUDIO_SPEAKER_STEREO

DSSPEAKER_QUAD

KSAUDIO_SPEAKER_QUAD

DSSPEAKER_SURROUND

KSAUDIO_SPEAKER_SURROUND

DSSPEAKER_5POINT1

KSAUDIO_SPEAKER_5POINT1

DSSPEAKER_7POINT1

KSAUDIO_SPEAKER_7POINT1

In the preceding table, DirectSound specifies both its headphone and stereo speaker configurations with the same channel mask, KSAUDIO_SPEAKER_STEREO. To distinguish between these two configurations, DirectSound sends the filter a second set-property request, which specifies a speaker geometry (see KSPROPERTY_AUDIO_STEREO_SPEAKER_GEOMETRY). To indicate headphones, DirectSound passes the value KSAUDIO_STEREO_SPEAKER_GEOMETRY_HEADPHONE with the speaker-geometry request.

In the case of stereo speakers, however, the caller to SetSpeakerConfig can specify one of several possible DSSPEAKER_Xxx stereo-speaker geometries. These appear in the left column of the following table, and the equivalent KSAUDIO_Xxx parameters appear on the right.

DSSPEAKER Stereo-Speaker Geometry KSAUDIO Stereo-Speaker Geometry

DSSPEAKER_GEOMETRY_WIDE

KSAUDIO_STEREO_SPEAKER_GEOMETRY_WIDE

DSSPEAKER_GEOMETRY_NARROW

KSAUDIO_STEREO_SPEAKER_GEOMETRY_NARROW

DSSPEAKER_GEOMETRY_MIN

KSAUDIO_STEREO_SPEAKER_GEOMETRY_MIN

DSSPEAKER_GEOMETRY_MAX

KSAUDIO_STEREO_SPEAKER_GEOMETRY_MAX

If the caller does not explicitly specify one of the geometries in the left column above, DirectSound assumes DSSPEAKER_GEOMETRY_WIDE by default.