Compartilhar via


IDirectSound8::GetSpeakerConfig Method

[The feature associated with this page, DirectSound, is a legacy feature. It has been superseded by WASAPI and Audio Graphs. Media Casting have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Media Casting instead of DirectSound, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The GetSpeakerConfig method retrieves the speaker configuration.

Syntax

HRESULT GetSpeakerConfig(
         LPDWORD pdwSpeakerConfig
)

Parameters

Return Value

If the method succeeds, the return value is DS_OK. If the method fails, the return value may be one of the error values shown in the following table.

Return code
DSERR_INVALIDPARAM
DSERR_UNINITIALIZED

Remarks

The value returned at pdwSpeakerConfig can be a packed DWORD containing both configuration and geometry information. Use the DSSPEAKER_CONFIG and DSSPEAKER_GEOMETRY macros to unpack the DWORD, as in the following example:

	
    if (DSSPEAKER_CONFIG(dwSpeakerConfig) == DSSPEAKER_STEREO)
      {
      if (DSSPEAKER_GEOMETRY(dwSpeakerConfig) ==
            DSSPEAKER_GEOMETRY_WIDE)
        {
          // Configuration is wide stereo.
     ...}
      }
	 

To use #defines implemented in Windows Vista, set the DIRECTSOUND_VERSION to 0x1000 before including dsound.h.

Requirements

Header: Declared in DSound.h.

Library: Use Dsound3d.dll.

See Also

IDirectSound8