Microsoft DirectX 8.1 (Visual Basic) |
The SimpleAudioPath sample demonstrates how different sounds can be played on an audiopath, and how the parameters of all sounds are affected by changes made on the audiopath.
Source: (SDK root)\Samples\Multimedia\VBSamples\DirectMusic\SimpleAudioPath
Executable: (SDK root)\Samples\Multimedia\VBSamples\DirectMusic\Bin
Click Lullaby, Snore, and Mumble to play different sounds. Adjust the 3-D position of the sounds by using the sliders. Click Rude Awakening to stop all other sounds.
The lullaby music is played as the primary segment, which means that only one instance of it can be playing at one time. You can play multiple instances of the snore and mumble sounds.
The audiopath is of type DMUS_APATH_DYNAMIC_3D. The path contains a 3-D buffer into which the synthesizer mixes all the sounds. To change the position of the sound, the application retrieves a DirectSound3DBuffer8 object from the path and calls DirectSound3DBuffer8.SetPosition.
When Rude Awakening is clicked, the audiopath is passed to DirectMusicPerformance8.PlaySegmentEx as the From parameter. This causes all segment instances playing on the audiopath to stop before the new segment begins.