Audio capture devices




Audio capture devices overview.


Audio Source
If AudioSource = as_Default (default value) the audio output of the video capture device will be used for recording (if this device exposes an audio output, e.g. like a DV camcorder), otherwise the audio output of the current audio capture device will be used.
If AudioSource is set to as_UseExternalAudio, the current audio capture device will be used for recording, even if the video capture device has an audio out.

Audio capture device
The current audio capture device is selected by AudioDevice , which is an index in the AudioDevices list, that contains AudioDevicesCount items.

It is possible to select the audiop capture device programmatically by name by using the FindIndexInListByName function, e.g.:

The name of the current audio capture device is reported by AudioDeviceName .

VideoGrabber.AudioDevice := VideoGrabber.FindIndexInListByName (VideoGrabber.AudioDevices, 'name of my audio device', false, true);

Note: AudioDevices and AudioDevices count are also available as global variables in Delphi and C++Builder.

Device-dependent properties
When an audio capture device is selected, its device-dependent properties are reloaded from the registry and the OnAudioDeviceSelected event occurs, therefore any control that uses e.g. the audio inputs should be refreshed from this event.

Audio inputs
After selecting an audio capture device, the AudioInputs lists returns the list of the audio inputs available for this audio capture device. An audio input can be selected by assigning the index of audio input in the list to the AudioInput property (in the 0...AudioInputsCount - 1 range).

Audio input level
The audio input level can be adjusted with AudioInputLevel (in the 0..65535) range.

Audio input balance
The audio input balance can be adjusted with AudioInputBalance in the -32768...32767 range (the center point is 0).
The audio input balance can be available or not, depending of the audio input. When preview or recording is running, IsAudioInputBalanceAvailable returns ts_True if the audio balance is available, and ts_False if not. If preview and recording are stopped, it returns ts_Undefined.

Audio recording
The recording of the current audio capture device is activated when AudioRecording is enabled.

Audio rendering
The audio rendering is activated when AudioDeviceRendering is enabled.
The audio volume can be adjusted with AudioVolume and the audio balance with AudioBalance.
To mute the audio volume enable/disable the MuteAudioRendering property.
These settings affect only the volume and balance of the audio rendering, not the volume and balance of the audio recording.

Device connection/disconnection
When an audio capture device is connected or disconnected, the OnDeviceArrivalOrRemoval event occurs. This event reports the name and index of the audio capture device in the global AudioDevices list.
After an audio capture device has been disconnected, IsAudioDeviceConnected returns true, until the device is reconnected.
If the related device is used by preview or recording, the OnDeviceLost event occurs when the device is disconnected, and the preview or recording stops.

See Also
TAudioFormat AssociateAudioAndVideoDevices AudioBalance AudioDevice AudioDeviceIndex AudioDeviceName AudioDeviceRendering AudioDevices AudioDevicesCount AudioFormat AudioFormats AudioInput AudioInputIndex AudioInputLevel AudioInputMono AudioInputs AudioInputsCount AudioSource IsAudioCrossbarAvailable IsAudioDeviceASoundCard IsAudioDeviceConnected IsAudioInputBalanceAvailable OnAudioBufferNegotiation OnAudioDeviceSelected SpeakerBalance SpeakerControl SpeakerVolume