Microsoft Windows CE 3.0  

Device Capabilities

Important:
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.

DirectSound allows 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 play more sounds if hardware mixing is available than if it is not.

After calling the DirectSoundCreatefunction to create a DirectSound object, your application can retrieve the capabilities of the sound device by calling the IDirectSound::GetCapsmethod.

The following example retrieves the capabilities of the device that was initialized in Creating the DirectSound Object.

DSCAPS dscaps; dscaps.dwSize = sizeof(DSCAPS);
HRESULT hr = lpDirectSound->lpVtbl->GetCaps(lpDirectSound,
&dscaps);

The DSCAPSstructure 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. Note that the dwSizemember of this structure must be initialized before the method is called.

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



 Last updated on Tuesday, May 18, 2004

© 2004 Microsoft Corporation. All rights reserved.