Minimizing Control Changes

Performance is affected when you change the pan, volume, or frequency on a secondary buffer. To prevent interruptions in sound output, the DirectSound mixer must mix ahead from 20 to 100 or more milliseconds. Whenever you make a control change, the mixer has to flush its mix-ahead buffer and remix with the changed sound.

It is a good idea to minimize the number of control changes you send. Try reducing the frequency of calls to routines that use the IDirectSoundBuffer::SetVolume, IDirectSoundBuffer::SetPan, and IDirectSoundBuffer::SetFrequency methods. 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.

© 1992-2003 Microsoft Corporation. All rights reserved.