Most sound cards support some level of hardware mixing if there is a DirectSound driver for the card. The following tips allow you to make the most of hardware mixing.
[Visual Basic]
Most sound cards support some level of hardware mixing if there is a DirectSound driver for the card. The following tips allow you to make the most of hardware mixing.
- At run time, use the DirectSound.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 lFlags member of the DSBUFFERDESC type. If you do this and resources for hardware mixing are not available, the DirectSound.CreateSoundBuffer method will fail.