Microsoft DirectX 9.0

Using Buffers Efficiently

When using streaming buffers, limit the frequency of notifications and data writes. Do not create buffers with many notification positions, or small buffers with notifications at very short intervals. A streaming buffer can hold a second or two of data and have just two notification positions.

Performance is affected when you change the pan, volume, or frequency on a secondary buffer. This is because DirectSound mixes sounds a short time before playing them, and any change causes the premix buffer to be flushed and remixed.

To minimize the number of control changes, reduce the frequency of calls to IDirectSoundBuffer8::SetVolume, IDirectSoundBuffer8::SetPan, and IDirectSoundBuffer8::SetFrequency. For example, if you have a routine that moves a sound from the left to the right speaker in synchronization with animation frames, try calling the SetPan method only every second or third frame. On 3-D buffers, use deferred settings to make

Keep in mind that 3-D buffers in software make high demands on the central processing unit. To limit these demands you can do the following:

See Also