On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
RTUSB-32 Programming Manual
RTUSB-32 Reference Manual
Introduction
Initialization
Device Query
Device Configuration
Pipe I/O
Message Queues
Keyboard Class Driver
Mouse Class Driver
Touch Screen Driver
Printer Class Driver
Mass Storage Class Driver
AX772 USB-Ethernet Driver
AX172 USB-Ethernet Driver
CDC ECM USB-Ethernet Driver
Audio Class Driver
Structure RTUSBAudioConfig
Function USBAudio
Function USBAudioGetInfo
Function USBAudioGetFrequency
Function USBAudioSetFrequency
Function USBAudioGetFeature
Function USBAudioSetFeature
Function USBAudioPlay
Function USBAudioRecord
Function USBAudioWaitDone
Function USBAudioTranslate
Function USBAudioDumpUnits
Media Transfer Protocol Class Driver
RTUSB-32 Error Codes and Diagnostics
|
Function USBAudioGetFeature
USBAudioGetFeature retrieves a feature value from a Feature Unit of an Audio function:
int USBAudioGetFeature(int AudioID, UINT Feature, UINT Channel);
ParametersAudioIDAudio ID value previously returned by function USBAudioGetInfo.
FeatureThe type of feature to query (see below). Optionally, flag USB_AUDIO_RAW may be ORed into this parameter.
ChannelThe audio channel to query. For some features, channel 0 specifies a "master" channel, typically when a single feature value applies to all channels. Other devices/features will support a unique feature value for each implemented audio channel starting at channel index 1. Please note that value USB_AUDIO_ALL_CHANNELS is not supported for this parameter.
return valueThe positive value of the requested feature or a negative error code in case of an error. If the audio function does not implement the requested feature/channel, RTU_NOT_AVAIL is returned.
The table below lists all supported Feature types and their respective supported range of values.
Feature |
Range |
Description |
USB_AUDIO_MUTE |
0..1 |
When the Mute feature is 1, the audio signal of this Audio function is surpressed. When it is 0, sound can be played or recorded. Most devices will implement this feature on channel 0. |
USB_AUDIO_VOLUME |
0..100 |
This feature controls the audio volume. It is typically implemented on each audio channel (1 for Mono, 1 and 2 for Stereo). Value 0 is the minimum (lowest) and 100 the maximum (highest) supported volume. |
USB_AUDIO_BASS |
0..100 |
This feature controls the intensity of bass (low frequency) sound. Value 0 is the minimum (lowest) and 100 the maximum (highest) bass volume. |
USB_AUDIO_MID |
0..100 |
This feature controls the intensity of mid (medium frequency) sound. Value 0 is the minimum (lowest) and 100 the maximum (highest) mid volume. |
USB_AUDIO_TREBLE |
0..100 |
This feature controls the intensity of treble (high frequency) sound. Value 0 is the minimum (lowest) and 100 the maximum (highest) treble volume. |
USB_AUDIO_AUTOMATIC_GAIN |
0..1 |
This feature controls the automatic gain. It is switched off with value 0 and on with value 1. |
USB_AUDIO_DELAY |
0..65535 |
This feature controls the delay of audio data in units of 1/64 ms (0.015625 ms). Such delays may be required to synchronize the sound from different sources. |
USB_AUDIO_BASS_BOOST |
0..1 |
This feature controls the bass boost. It is switched off with value 0 and on with value 1. |
USB_AUDIO_LOUDNESS |
0..1 |
This feature controls the loudness. It is switched off with value 0 and on with value 1. |
If optional flag USB_AUDIO_RAW is ORed into the Feature parameter, the value returned for features USB_AUDIO_VOLUME, USB_AUDIO_BASS, USB_AUDIO_MID, and USB_AUDIO_TREBLE is returned without scaleing into range 0..100. How these values are interpreted is defined in the USB Audio Specification.
Initially, many USB Audio devices have an invalid or inappropriate volume level. Before an Audio function is used, it is recommended to set the USB_AUDIO_MUTE feature to 0 and the USB_AUDIO_VOLUME of all channels (e.g. using Channel parameter USB_AUDIO_ALL_CHANNELS) to a defined value. Features can be set using function USBAudioSetFeature.
Function USBAudioSetFrequency
Function USBAudioSetFeature
|