Microsoft DirectX 8.1 (Visual Basic) |
The AdjustSound sample shows how to create a DirectSound secondary buffer to play a wave file, and how to change the parameters of the buffer.
Source: (SDK root)\Samples\Multimedia\VBSamples\DirectSound\AdjustSound
Executable: (SDK root)\Samples\Multimedia\VBSamples\DirectSound\Bin
Load a wave file by clicking Sound File. Select the Focus and Buffer Mixing options; note that the various settings are explained under Expected Behavior as you select them. Click Play. If you don't hear any sound, check the Status pane. The application might fail to create the buffer in hardware if this option has been selected.
By using the sliders, you can adjust the frequency, pan, and volume dynamically as the buffer is playing.
The application attempts to create a sound buffer when the file is loaded, and each time Play is clicked, using whatever options are selected at the time.