Microsoft Windows CE 3.0  

Minimizing Control Changes

This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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's 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::SetFrequencymethods. 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 SetPanmethod only every second or third frame.

 Last updated on Tuesday, May 18, 2004

© 2004 Microsoft Corporation. All rights reserved.