IDirectSoundBuffer Interface

The IDirectSoundBuffer interface enables your application to work with buffers of audio data. Audio data resides in a DirectSound buffer. Your application creates DirectSound buffers for each sound or audio stream to be played.

The primary sound buffer represents the actual audio samples sent to the sound device. These samples can be a single audio stream or the mixed output of several audio streams. Applications typically do not directly access the audio data in a primary sound buffer. However, the primary buffer can be used for control purposes, such as setting the output volume or wave format.

A secondary sound buffer represents a single output stream or sound. Your application can play this buffer into the primary sound buffer. Secondary sound buffers that play concurrently are mixed into the primary buffer, which is then sent to the sound device.

Note DirectSoundBuffer objects are owned by the DirectSound object that created them. When the DirectSound object is released, all buffers created by that object also will be released and should not be referenced.

This section discusses how your application can manage sound-buffer playback; track and control volume, frequency, and pan settings; retrieve sound-buffer information; and manage memory.

·Play Management

·Sound-Environment Management

·Retrieving Information

·Memory Management