Audio Compression Manager (ACM) drivers are stream interface drivers. Like other stream interface drivers, ACM drivers are controlled by the Device Manager, and they expose standard stream I/O functions. However, unlike other stream interface drivers, applications do not use these drivers directly. ACM drivers are called by the Audio Compression Manager, which sends messages to ACM drivers when applications need to play or record sounds.
There are several key reasons to write an ACM driver:
An individual ACM driver can be written to perform a combination of these tasks.
All ACM drivers must use ACM as their device file name prefix. In Windows CE, the Index keys in the registry settings designate individual ACM drivers. Thus, multiple ACM drivers have special device file names such as “ACM1:”, “ACM2:”, and so on. A maximum of eight ACM drivers can coexist on a Windows CE–based platform; Index value 9 is reserved for the PCM converter exported from Waveapi.dll.
The ACM uses Index keys when searching for an ACM driver to perform format conversions. The ACM selects the first appropriate ACM driver that it finds. For more details about device file names, see Device File Name Prefixes. For more information about Index keys, see Device File Name Indexes.
ACM drivers respond to messages similar to those used by ACM drivers written for Windows NT. In fact, the Windows CE–based ACM functions and structures that ACM drivers use are the same as those described in the Windows NT Device Driver Kit. On Windows CE, the ACM uses the ACM_IOControl function to send messages to the driver. By calling this function, the ACM bypasses the three primary stream I/O functions: XXX_Read, XXX_Write, and XXX_Seek. Consequently, those functions are never called in an ACM driver. The ACM uses the other stream I/O functions only for setup and shutdown tasks.
The Windows NT Device Driver Kit contains several sample ACM drivers. You can port these drivers to work on any Windows CE–based platforms that your product targets, and you can modify the drivers to support additional audio format types and audio filter types. The Windows NT Device Driver Kit contains complete documentation on writing ACM drivers. For more information, see Porting a Windows NT ACM Driver to Windows CE.