Microsoft DirectX 8.1 (Visual Basic)

Device Capabilities

DirectSound enables your application to retrieve the hardware capabilities of the sound device. Most applications will not need to do this, because DirectSound automatically takes advantage of any available hardware acceleration. However, high-performance applications can use the information to scale their sound requirements to the available hardware. For example, an application might choose to play more sounds if hardware mixing is available than if it is not.

After calling the DirectX8.DirectSoundCreate method to create a DirectSound8 object, your application can retrieve the capabilities of the sound device by calling the DirectSound8.GetCaps method.

The following example retrieves the capabilities of the device represented by the DirectSound8 object m_ds:

Dim caps As DSCAPS
m_ds.GetCaps caps 

The DSCAPS type receives information about the performance and resources of the sound device, including the maximum resources of each type and the resources that are currently available.

If your application scales to hardware capabilities, you should call the DirectSound8.GetCaps method between every buffer allocation to determine if there are enough resources to create the next buffer.