共用方式為


DirectSound Interfaces

[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 section contains reference information about interfaces provided by the Microsoft DirectSound API.

Function Description
IDirectSound8 Used to create buffer objects and set up the environment.
IDirectSound3DBuffer8 Used to retrieve and set parameters that describe the position, orientation, and environment of a sound buffer in 3-D space.
IDirectSound3DListener8 Used to retrieve and set parameters that describe a listener's position, orientation, and listening environment in 3-D space.
IDirectSoundBuffer8 Used to manage sound buffers.
IDirectSoundCapture8 Used to create sound capture buffers.
IDirectSoundCaptureBuffer8 Used to manipulate sound capture buffers.
IDirectSoundCaptureFXAec8 Used to set and retrieve parameters on a capture buffer that supports acoustic echo cancellation.
IDirectSoundCaptureFXNoiseSuppress8 Used to set and retrieve parameters on a capture buffer that supports noise suppression.
IDirectSoundFullDuplex8 Represents a full-duplex stream.
IDirectSoundFXChorus8 Used to set and retrieve effect parameters on a buffer that supports chorus.
IDirectSoundFXCompressor8 Used to set and retrieve effect parameters on a buffer that supports compression.
IDirectSoundFXDistortion8 Used to set and retrieve effect parameters on a buffer that supports distortion.
IDirectSoundFXEcho8 Used to set and retrieve effect parameters on a buffer that supports echo.
IDirectSoundFXFlanger8 Used to set and retrieve effect parameters on a buffer that supports flange.
IDirectSoundFXGargle8 Used to set and retrieve effect parameters on a buffer that supports amplitude modulation.
IDirectSoundFXI3DL2Reverb8 Used to set and retrieve effect parameters on a buffer that supports I3DL2 (Interactive 3D Audio Level 2) reverberation effects.
IDirectSoundFXParamEq8 Used to set and retrieve effect parameters on a buffer that supports parametric equalizer effects.
IDirectSoundFXWavesReverb8 Used to set and retrieve effect parameters on a buffer that supports Waves reverberation effects.
IDirectSoundNotify8 Sets up notification events for a playback or capture buffer.
IKsPropertySet Enables drivers to provide extended capabilities that can be used without API extensions.

For DirectX 8.0 and later, only IDirectSound8, IDirectSoundBuffer8, and IDirectSoundCaptureBuffer8 are new interfaces that supersede interfaces with similar, unnumbered names. Other interface names ending in 8 are simple defines for unchanged or new unnumbered interfaces. For example, IDirectSoundCapture8 is exactly equivalent to IDirectSoundCapture.

All interfaces that have a defined name ending in 8 are documented under that defined name, and it is recommended that you always use this name in your code.

For information on which methods are supported by an earlier version of an interface, see the declaration of the interface in Dsound.h.

When a method takes an interface pointer as an in parameter, you can pass in the newer version even where the parameter type is declared as the earlier version. For example, a pointer to either IDirectSoundBuffer or IDirectSoundBuffer8 can be passed to IDirectSound8::DuplicateSoundBuffer as the pDSBufferOriginal parameter.

When a method returns an interface, however, it is usually the earlier interface, and to obtain the newer interface you must use QueryInterface. This is the case, for example, with the ppDSBuffer parameter of IDirectSound8::CreateSoundBuffer.