![]() |
![]() |
![]() |
Minimizing Control Changes |
Language: |
Performance is affected when you change the pan, volume, or frequency on a secondary buffer. To prevent interruptions in sound output, the Microsoft® 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 SecondaryBuffer.Volume, .Pan, and .Frequency. For example, if you have a routine that moves a sound from the left to the right speaker in synchronization with animation frames, try setting Pan only every second or third frame.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center