Share via


IDirectSoundBuffer

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

Applications use the methods of the IDirectSoundBuffer interface to create DirectSoundBuffer objects and set up the environment.

The interface is obtained by using the IDirectSound::CreateSoundBuffer method.

The IDirectSoundBuffer methods can be organized into the following groups:

Information GetCaps
GetFormat
GetStatus
SetFormat
Memory management Initialize
Restore
Play management GetCurrentPosition
Lock
Play
SetCurrentPosition
Stop
Unlock
Sound management GetFrequency
GetPan
GetVolume
SetFrequency
SetPan
SetVolume

All COM interfaces inherit the IUnknown interface methods. This interface supports the following three methods:

IUnknown AddRef
QueryInterface
Release

The LPDIRECTSOUNDBUFFER type is defined as a pointer to the IDirectSoundBuffer interface.

typedef struct IDirectSoundBuffer    *LPDIRECTSOUNDBUFFER;

Requirements

Header: Declared in DSound.h.

Library: Use Dsound.lib.

See Also

IDirectSound::CreateSoundBuffer