IDirectSound::GetCaps

[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.]

This method retrieves the capabilities of the hardware device that is represented by the DirectSound object.

Syntax

HRESULT GetCaps( LPDSCAPS lpDSCaps );

Parameters

  • lpDSCaps
    Address of the DSCAPS structure to contain the capabilities of this sound device.

Return Value

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:

Return Code
DSERR_GENERIC
DSERR_INVALIDPARAM
DSERR_UNINITIALIZED

Remarks

Information retrieved in the DSCAPS structure describes the maximum capabilities of the sound device and those currently available, such as the number of hardware mixing channels and the amount of on-board sound memory. You can use this information to fine-tune performance and optimize resource allocation.

Because of resource-sharing requirements, the maximum capabilities in one area might be available only at the cost of another area. For example, the maximum number of hardware-mixed streaming sound buffer might be available only if there are no hardware static sound buffers.

Requirements

Header: Declared in DSound.h.

Library: Use Dsound.lib.

See Also

DirectSoundCreate
DSCAPS