Hardware Abstraction and Emulation

DirectSound accesses the sound hardware through the DirectSound hardware abstraction layer (HAL), an interface that is implemented by the audio device driver.

The DirectSound HAL provides the following functionality:

  • Acquires and releases control of the audio hardware
  • Describes the capabilities of the audio hardware
  • Performs the specified operation when hardware is available
  • Causes the operation request to report failure when hardware is unavailable

The device driver does not perform any software emulation; it simply reports the capabilities of the hardware to DirectSound and passes requests from DirectSound to the hardware. If the hardware cannot perform a requested operation, the device driver reports failure of the request and DirectSound emulates the operation.

Your application can use DirectSound as long as the DirectX run-time files are present on the user's system. If the sound hardware does not have an installed DirectSound driver, but has a Waveform Device Driver, DirectSound uses its hardware emulation layer (HEL), which will then use the wavedev driver. Most DirectSound features are still available through the HEL, but of course hardware acceleration is not possible. To find out whether your application is running under an emulation driver, call the IDirectSound::GetCaps method and check for the DSCAPS_EMULDRIVER flag.

DirectSound automatically takes advantage of accelerated sound hardware, including hardware mixing and hardware sound buffer memory. Your application need not query the hardware or program specifically to use hardware acceleration. However, for you to make the best possible use of the available hardware resources, you can query DirectSound at run time (by using the various GetCaps methods) to receive a full description of the capabilities of the sound device, and then use different routines optimized for the presence or absence of a given feature. You can also specify which sound buffers should receive hardware acceleration.

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.