DirectX SDK |
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:
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, DirectSound uses its hardware emulation layer (HEL), which employs the Windows multimedia waveform-audio (waveIn and waveOut) functions. 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 in C++ or the DirectSound.GetCaps method in Visual Basic 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.