DirectX SDK |
This topic pertains only to application development in C and C++. See DirectSound Visual Basic Samples.
This application shows how to play a wave file with 3-D positioning using DirectSound.
Source: Mssdk\Samples\Multimedia\DSound\Src\Play3DSound
Executable: Mssdk\Samples\Multimedia\DSound\Bin\Play3DSound.exe
Click the Sound File button to load a wave file, and select an option in the Select 3-D Algorithm dialog box. Click Play to play the sound with looping. Adjust the playback properties by using the sliders. Click Defer if you do not want changes to be applied immediately; you can adjust the frequency at which new settings are committed by using the slider beside the button. The position of the sound source in relation to the listener is displayed as a red dot on the graph. Adjust the range of the sound's movement by using the sliders below and beside the graph.
The sample shows the basics of playing a sound using the 3-D features of DirectSound, and how to use IDirectSound3DListener::CommitDeferredSettings to change multiple parameters at the same time.