Control Options

When creating a sound buffer, your application must specify the control options needed for that buffer. This can be done with the dwFlags member of the DSBUFFERDESC structure, which can contain one or more DSBCAPS_CTRL flags. DirectSound uses this information when allocating hardware resources to sound buffers. For example, a particular device might support hardware buffers but provide no pan control on those buffers. In this case, DirectSound would only use hardware acceleration if the DSBCAPS_CTRLPAN flag was not specified.

To obtain the best performance on all sound cards, your application should only specify those control options which it will actually use.

If your application calls a method that a buffer lacks, that method fails. For example, if you attempt to change the volume by using theIDirectSoundBuffer::SetVolume method, it will succeed if the DSBCAPS_CTRLVOLUME flag was specified when the buffer was created. Otherwise, the method fails and returns the DSERR_CONTROLUNAVAIL error code. Providing controls for the buffers helps to ensure that all applications run correctly on all existing or future sound devices.