DirectSoundSecondaryBuffer8
An object of the DirectSoundSecondaryBuffer8 class represents a secondary play buffer. Sounds from secondary buffers are mixed into the primary buffer.
The object can be obtained by using the DirectSound8.CreateSoundBuffer, DirectSound8.CreateSoundBufferFromFile, or DirectSound8.CreateSoundBufferFromResource method. In applications that use audiopaths, a secondary buffer can be retrieved by using the DirectMusicAudioPath8.GetObjectInPath method.
The DirectSoundSecondaryBuffer8 class has the following methods.
Buffer information
Method |
Description |
GetCaps |
Retrieves the capabilities of the buffer. |
GetFormat |
Retrieves a description of the wave format of the buffer. |
GetStatus |
Retrieves the status of the sound buffer. |
Effects and 3-D
Method |
Description |
GetDirectSound3DBuffer |
Retrieves an object that can be used to manipulate 3-D effects on the buffer. |
GetObjectInPath |
Retrieves an object, typically an effect , in the audiopath of the buffer. |
SetFX |
Sets effects for sounds in the buffer. |
Play management
Method |
Description |
GetCurrentPosition |
Retrieves the position of the play and write cursors. |
GetFrequency |
Retrieves the sample frequency at which the buffer is playing. |
GetPan |
Retrieves the relative volume between the left and right audio channels. |
GetVolume |
Retrieves the sound volume of the sound buffer. |
Play |
Causes the sound buffer to play from the play cursor. |
ReadBuffer |
Reads a portion of the sound buffer and stores the data in an application buffer. |
SetCurrentPosition |
Sets the position of the play cursor. |
SetFrequency |
Sets the frequency at which the audio samples are played. |
SetNotificationPositions |
Sets positions where the play cursor signals events. |
SetPan |
Specifies the relative volume between the left and right channels. |
SetVolume |
Sets the sound volume. |
Stop |
Causes the sound buffer to stop playing. |
WriteBuffer |
Writes to a portion of the sound buffer from an application buffer holding audio data. |
Resource management
Method |
Description |
AcquireResources |
Allocates resources for a buffer created with the DSBCAPS_LOCDEFER flag. |
Restore |
Restores the memory allocation for a lost sound buffer. |
Miscellaneous
Method |
Description |
SaveToFile |
Saves the contents of the buffer to a wave file. |
The following table shows which methods are supported for buffer objects obtained from an audiopath; that is, buffers created by a DirectMusic performance. Mix-in buffers accept sends from other buffers. All other buffers in the audiopath are sink-in buffers, which means that they accept data only from the synthesizer sink.
DirectSoundSecondaryBuffer8 method |
Mix-in |
Sink-in |
AcquireResources |
|
|
GetCaps |
Yes |
Yes |
GetCurrentPosition |
|
|
GetDirectSound3D Buffer |
Yes |
Yes |
GetFormat |
Yes |
Yes |
GetFrequency |
|
|
GetObjectInPath |
Yes |
Yes |
GetPan |
Yes |
Yes |
GetStatus |
Yes |
Yes |
GetVolume |
Yes |
Yes |
Play |
Yes |
|
ReadBuffer |
|
|
Restore |
|
|
SaveToFile |
|
|
SetCurrentPosition |
|
|
SetFrequency |
|
|
SetFX |
Yes |
Yes |
SetNotificationPositions |
|
|
SetPan |
Yes |
Yes |
SetVolume |
Yes |
Yes |
Stop |
Yes |
|
WriteBuffer |
|
|
See Also