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.
Most sound cards support some level of hardware mixing if there
is a DirectSound driver for the card. The following tips will allow
you to make the most of hardware mixing:
Use static buffers for sounds that you want to be mixed in
hardware. DirectSound will attempt to use hardware mixing on static
buffers.
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.
At run time, use the
IDirectSound::GetCapsmethod to determine what formats are
supported by the sound-accelerator hardware and use only those
formats if possible.
To create a static buffer, specify the DSBCAPS_STATIC flag in
the
dwFlagsmember of the
DSBUFFERDESCstructure
when you create a secondary buffer. You can also specify the
DSBCAPS_LOCHARDWARE flag to force hardware mixing for a buffer,
however, if you do this and resources for hardware mixing are not
available, the
IDirectSound::CreateSoundBuffermethod will fail.