Class: AudioInput
A generic event target class designed for strongly-typed event handling. OdinEventTarget extends the functionality of the standard EventTarget to allow interactions with predefined event types and handlers.
Extends
Constructors
new AudioInput()
new AudioInput(
_settings
,_capture
):AudioInput
Parameters
• _settings: InputSettings
• _capture: AudioCapture
Returns
Overrides
Defined in
ari/lib/api/media/audio-input.d.ts:39
Properties
activityHandler()
activityHandler: () =>
void
Gets called to update PowerLevel and AudioActivity. Primarily for internal usage and might get removed in the future.
Returns
void
Deprecated
Defined in
ari/lib/api/media/audio-input.d.ts:32
kind
readonly
kind:"audio-input"
="audio-input"
Defined in
ari/lib/api/media/audio-input.d.ts:12
onAudioActivity()?
optional
onAudioActivity: (payload
) =>void
A callback function that is invoked when audio activity occurs and voice activity detection (VAD) was set to true.
Parameters
• payload: AudioActivityPayload
An object containing the AudioMedia.
Returns
void
Defined in
ari/lib/api/media/audio-input.d.ts:18
onPowerLevel()?
optional
onPowerLevel: (payload
) =>void
A callback function invoked when there is an update to the audio power level in rmsDBFS. This function can be used to handle or process audio activity, such as monitoring sound levels or visualizing audio input.
Parameters
• payload: AudioActivityPayload
An object containing the AudioMedia.
Returns
void
Defined in
ari/lib/api/media/audio-input.d.ts:26
Accessors
capture
get
capture():AudioCapture
The AudioCapture that is provided by the underling plugin.
Returns
The AudioCapture of the underling plugin.
Defined in
ari/lib/api/media/audio-input.d.ts:45
isActive
get
isActive():boolean
Whether the AudioInput is currently active or not. Only works when voice activity detection was enabled.
Returns
boolean
True if the instance is active, false otherwise.
Defined in
ari/lib/api/media/audio-input.d.ts:68
powerLevel
get
powerLevel():number
Retrieves the Root Mean Square (RMS) in decibels relative to full scale (dBFS) for the captured audio activity. This is a measure of the average power level of the audio signal.
Returns
number
The RMS value expressed in dBFS.
Defined in
ari/lib/api/media/audio-input.d.ts:83
volume
get
volume():InputVolume
Retrieves the current volume. Is the Volume 'muted', the associated Device was stopped.
Returns
The current volume level.
Defined in
ari/lib/api/media/audio-input.d.ts:52
Methods
addEventListener()
addEventListener<
OdinEventType
>(eventName
,handler
,options
?):void
Type Parameters
• OdinEventType extends keyof MediaEvents