Microsoft DirectX 8.1 (Visual Basic) |
The DefferedEffects sample demonstrates how to create deferred sound buffers with effects. Resources are not allocated to the buffers until the application requests them.
Source: (SDK root)\Samples\Multimedia\VBSamples\DirectSound\DeferredEffects
Executable: (SDK root)\Samples\Multimedia\VBSamples\DirectSound\Bin
Load a wave file by clicking the button beside the top text box. Select an effect in the top list and move it to the bottom list by clicking the down arrow, or by double-clicking the effect. Remove an effect by selecting it in the bottom list and clicking on the up arrow, or by double-clicking the effect. Update the effects on the buffer by clicking Apply Effects. Note that the status of each effect is given in the Effects in Use list. Play the sound.
The sound buffer is created with the DSBCAPS_LOCDEFER flag, so that no resources are allocated to it until it is played, or until the application calls DirectSoundSecondaryBuffer8.AcquireResources.
The buffer is still deferred when DirectSoundSecondaryBuffer8.SetFX is called. The application then immediately calls AcquireResources to allocate resources to the buffer. It then ascertains whether the effects were successfully instantiated, and whether they are in hardware or software. (In DirectX 8.0, all effects are in software.)