Using Hardware Mixing
Most sound cards support some level of hardware mixing if there is a DirectSound driver for the card. The following tips will enable you to make the most of hardware mixing:
- At run time, use the IDirectSound8::GetCaps method to determine what formats are supported by the sound-accelerator hardware and use only those formats if possible.
- Create sound buffers first for the sounds you use the most. There is a limit to the number of buffers that can be mixed by hardware.
- To force a buffer to be created in hardware, specify the DSBCAPS_LOCHARDWARE flag in the dwFlags member of the DSBUFFERDESC structure. If you do this and resources for hardware mixing are not available, the IDirectSound8::CreateSoundBuffer method will fail.
- Use voice management to enable DirectSound to assign buffers to hardware resources when they are available, and to force termination of less important buffers in order to free hardware resources. See Dynamic Voice Management.