Поделиться через


IDirectSound8

[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 IDirectSound8 interface is used to create buffer objects, manage devices, and set up the environment. This interface supersedes IDirectSound and adds new methods.

Obtain this interface by using the DirectSoundCreate8 or DirectSoundFullDuplexCreate8 function, or by using CoCreateInstance or CoCreateInstanceEx to create an object of class CLSID_DirectSound8.

In addition to the methods inherited from IUnknown, the IDirectSound8 interface exposes the following methods.

IDirectSound8 Members

Method Description
IDirectSound8::Compact The Compact method has no effect.
IDirectSound8::CreateSoundBuffer The CreateSoundBuffer method creates a sound buffer object to manage audio samples.
IDirectSound8::DuplicateSoundBuffer The DuplicateSoundBuffer method creates a new secondary buffer that shares the original buffer's memory.
IDirectSound8::GetCaps The GetCaps method retrieves the capabilities of the hardware device that is represented by the device object.
IDirectSound8::GetSpeakerConfig The GetSpeakerConfig method retrieves the speaker configuration.
IDirectSound8::Initialize The Initialize method initializes a device object that was created by using the CoCreateInstance function.
IDirectSound8::SetCooperativeLevel The SetCooperativeLevel method sets the cooperative level of the application for this sound device.
IDirectSound8::SetSpeakerConfig The SetSpeakerConfig method specifies the speaker configuration of the device.
IDirectSound8::VerifyCertification The VerifyCertification method ascertains whether the device driver is certified for DirectX.

The LPDIRECTSOUND8 type is defined as a pointer to the IDirectSound8 interface:

typedef struct IDirectSound8  *LPDIRECTSOUND8;

Remarks

Only objects of class CLSID_DirectSound8 support this interface. All device objects created by DirectSoundCreate8 and DirectSoundFullDuplexCreate8 fall into this category. Objects of class CLSID_DirectSound, which include all those created by using the earlier DirectSoundCreate function, support only the earlier IDirectSound interface.

The behavior of CLSID_DirectSound8 objects is somewhat different from that of CLSID_DirectSound objects. These differences are found in the IDirectSound interface as well as the IDirectSound8 interface. Specific differences in the behavior of the newer object include the following:

  • In calls to IDirectSound::CreateSoundBuffer and CreateSoundBuffer, DSBCAPS_CTRL3D cannot be set on a buffer with a non-mono format, and DSBCAPS_CTRL3D cannot be combined with DSBCAPS_CTRLPAN.

  • New buffer creation flags are supported.

  • Buffers are not filled with silence on creation.

  • The IDirectSoundBuffer interface returned by CreateSoundBuffer can be queried for the IDirectSoundBuffer8 interface.

  • WAV formats in the DSBUFFERDESC structure that have the WAVE_FORMAT_EXTENSIBLE format tag are checked more strictly for validity.

Requirements

Header: Declared in DSound.h.

Library: Use Dsound3d.dll.

See Also

DirectSound Interfaces