Mixing

The most used feature of DirectSound is the low-latency mixing of audio streams. Your application can create one or more secondary sound buffers and write audio data to them. You can choose to play or stop any of these buffers. DirectSound mixes all playing buffers and writes the result to the primary sound buffer, which supplies the sound hardware with audio data. There are no limitations to the number of buffers that can be mixed, except the practicalities of available processing time.

Low-latency mixing allows the user to experience no perceptible delay between the time that a buffer plays and the time that the speakers reproduce the sound. In practical terms, this means that the latency is 20 milliseconds or less. The DirectSound mixer provides 20 milliseconds of latency, so there is no perceptible delay before play begins. Under these conditions, if your application plays a buffer and immediately begins a screen animation, the audio and video appear to start synchronously. However, if DirectSound must use the HAL emulation layer (if a DirectSound driver for the sound hardware is not present), the mixer cannot achieve low latency and a hardware-dependent delay, typically 100-150 milliseconds, occurs before the sound is reproduced.

Because only one application at a time can open a particular DirectSound device, only buffers from a single application are audible at any given instance.