Home |
AX772/AX178 and AX172 USB-Ethernet Drivers Audio Class Driver |
Audio Class DriverThe USB Audio Class Driver supports devices which adhere to the Universal Serial Bus Device Class Definition for Audio Devices, Release 1.0. Both playing and recording sound is supported. To use the driver, applications must register the driver's attachment/detachment callback USBAudio using RTURegisterCallback before any USB host controllers are registered. Subsequently, function USBAudioGetInfo can be used to get information about attached Audio device functions. A single Audio device can implement several Audio functions. For example, a USB head set could implement a function to play stereo sound, another to play mono sound, and a third to record mono sound. The RTUSB-32 Audio class driver assigns a unique Audio ID to each audio function when a new Audio device is attached. The Audio ID is returned by USBAudioGetInfo and can then be used to identify this Audio function. The driver can manage up to 8 Audio functions simultaneously. Functions USBAudioGetFrequency / USBAudioSetFrequency as well as USBAudioGetFeature / USBAudioSetFeature can be used to configure the device. Functions USBAudioPlay and USBAudioRecord are used to play or record sound. To be able to send or receive a contiguous data stream to/from the Audio function, the driver uses several simultaneous transactions. By default, 2 transactions can be queued before one must finish, but applications can increase this value, if desired. While one set of data buffers is being streamed, the application can prepare the next buffer and then queue it for processing. Function USBAudioWaitDone is used to wait for pending transactions to finish. Function USBAudioTranslate can be used to translate audio data formats, which may be required when an Audio function expects data in a different format than available. Demo program Audiodemo shows how the Audio Class driver can be used. The demo also contains sample code to read and create .wav files. Media Transfer Protocol Class Driver
|