Microsoft Windows CE 3.0  

Audio Drivers

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.

A waveform audio driver is responsible for processing messages from the Wave API Manager to play and record waveform audio. Waveform audio drivers are implemented as stream interface drivers that are loaded by the Device Manager. The sample waveform audio driver is named WaveDev.dll. All audio drivers use the prefix WAV to name their stream interface functions, yielding function names such as WAV_Open, WAV_IOControl, and so on.

Audio hardware typically supports a larger set of operations than usually apply to files. For example, files commonly do not have volume controls or playing speed controls, but audio hardware can and often does have them. The DeviceIOControlportion of the stream interface allows arbitrary operations on files, making it possible to manipulate audio hardware by means of WAV_IOControl. To send commands to the audio hardware, the operating system passes various messages to this function. For example, to prepare the audio hardware for recording, Waveapi.dll uses WAV_IOControlto send the WIDM_PREPARE message to the audio driver. The messages sent to the audio driver are similar to those used by user-mode audio drivers on Windows-based desktop platforms, such as Mmdrv.dll.

Because audio drivers rely entirely on DeviceIOControlfunction messages, the implementation of the remainder of the stream interface is relatively simple. Specifically, the WAV_Read, WAV_Seek, and WAV_Writefunctions are merely stubs that return constant values. The other stream interface functions should be fully implemented and follow the conventions described in the Microsoft Windows CE API Referencefor those functions.

As an alternative to implementing the stream interface directly, you can use the model device driver (MDD) library — Wavemdd.lib — supplied by Microsoft. This library implements the stream interface functions in terms of the audio device driver service-provider interface (DDSI) functions. If you use Wavemdd.lib, you must create a matching platform-dependent driver (PDD) library that implements the audio DDSI functions. The PDD library is generally called Wavepdd.lib, although there is no requirement that it be called this. These two libraries can then be linked together to form Wavedev.dll.

The following illustration shows the interaction of the audio driver with the Windows CE operating system (OS).

As shown in the illustration, the first step in playing and recording sounds is a call from an application to the OS. The OS translates such calls into WAV_IOControlcalls to the audio driver. The OS component that performs this translation is the Wave API Manager. The audio driver then executes the appropriate actions on the hardware. The Device Manager only loads and registers the audio driver at startup time. It is not directly involved in the operation of the driver.

Like standard stream interface drivers, the audio driver uses registry keys both to store configuration information and to advertise itself to the OS. If the audio driver is not already listed in Platform.reg, create a key called HKEY_LOCAL_MACHINE\Drivers\Builtin\Audioto store configuration information. The Device Manager creates a key in HKEY_LOCAL_MACHINE\Drivers\Activefor the audio driver when the driver is loaded at startup time. Because the Device Manager only checks for audio drivers at startup time, drivers for add-on audio hardware still need to have their registry entries in the \Builtin\Audiopart of the registry, although their hardware is not built into any Windows CE–based platform.

The following list shows the stream interface functions for the audio driver:

WAV_Close WAV_PowerDown
WAV_Deinit WAV_PowerUp
WAV_Init WAV_Read
WAV_IOControl WAV_Seek
WAV_Open WAV_Write

For more information, see Developing Stream Interface Device Drivers.

The following list shows the DDSI functions for the audio driver:

PDD_AudioDeinitialize
PDD_AudioGetInterruptType
PDD_AudioInitialize
PDD_AudioMessage
PDD_AudioPowerHandler
PDD_WaveProc


 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.