Skip to main content

Class: AudioOutput

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 AudioOutput()

new AudioOutput(playback, _mediaData, peer, room): AudioOutput

Parameters

playback: AudioPlayback

The AudioPlayback that is provided by the underling plugin.

_mediaData

_mediaData.id: number

_mediaData.paused: boolean

_mediaData.properties: object | object

peer: RemotePeer

room: Room

Returns

AudioOutput

Overrides

OdinEventTarget.constructor

Defined in

ari/lib/api/media/audio-output.d.ts:43

Properties

kind

readonly kind: "audio-output" = "audio-output"

Defined in

ari/lib/api/media/audio-output.d.ts:19


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-output.d.ts:28


onJitterStats()?

optional onJitterStats: (payload) => void

Optional callback function that is invoked to handle jitter statistics.

Parameters

payload: JitterStats

The object containing metrics or data related to jitter statistics.

Returns

void

Defined in

ari/lib/api/media/audio-output.d.ts:42


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-output.d.ts:36


peer

readonly peer: RemotePeer

Defined in

ari/lib/api/media/audio-output.d.ts:17


playback

readonly playback: AudioPlayback

The AudioPlayback that is provided by the underling plugin.

Defined in

ari/lib/api/media/audio-output.d.ts:15


room

readonly room: Room

Defined in

ari/lib/api/media/audio-output.d.ts:18

Accessors

customType

get customType(): string

The custom type helps to identify the purpose of the VideoOutput. When adding the VideoInput to a room, the customType can be used by remote peers to understand the purpose of the stream.

Returns

string

The custom type value if available; otherwise, undefined.

Defined in

ari/lib/api/media/audio-output.d.ts:76


isActive

get isActive(): boolean

Whether the AudioOutput 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-output.d.ts:68


isPaused

get isPaused(): boolean

Retrieves the paused state of the object.

Returns

boolean

Returns true if the object is in a paused state, otherwise false.

Defined in

ari/lib/api/media/audio-output.d.ts:103


jitterStats

get jitterStats(): JitterStats

Retrieves the jitter statistics for the playback.

Returns

JitterStats

The jitter statistics data associated with the playback.

Defined in

ari/lib/api/media/audio-output.d.ts:117


mediaId

get mediaId(): number

Retrieves the media ID associated with this instance.

Returns

number

The unique identifier of the media.

Defined in

ari/lib/api/media/audio-output.d.ts:61


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-output.d.ts:111


uid

get uid(): string

Retrieves the unique identifier (UID) associated with the playback.

Returns

string

The UID of the playback.

Defined in

ari/lib/api/media/audio-output.d.ts:55


volume

get volume(): OutputVolume

Retrieves the current volume.

Returns

OutputVolume

The volume number or 'muted'.

Defined in

ari/lib/api/media/audio-output.d.ts:82


volumeAggregated

get volumeAggregated(): number

Gets the aggregated volume (room * peer * audioOutput) that is currently in use.

Returns

number

The current aggregated volume level, or 0 if volume is not defined.

Defined in

ari/lib/api/media/audio-output.d.ts:88

Methods

addEventListener()

addEventListener<OdinEventType>(eventName, handler, options?): void

Type Parameters

OdinEventType extends keyof MediaEvents

Parameters

eventName: OdinEventType

handler: MediaEvents[OdinEventType]

options?: boolean | AddEventListenerOptions

Returns

void

Inherited from

OdinEventTarget.addEventListener

Defined in

ari/lib/utils/odin-event-target.d.ts:26


dispatchActivity()

dispatchActivity(): void

Dispatches activity events. This method might get removed and should not be used outside the SDK.

Returns

void

Deprecated

Defined in

ari/lib/api/media/audio-output.d.ts:133


dispatchEvent()

dispatchEvent<T>(event): void

Type Parameters

T extends OdinEvent<any>

Parameters

event: T

Returns

void

Inherited from

OdinEventTarget.dispatchEvent

Defined in

ari/lib/utils/odin-event-target.d.ts:27


dispatchPowerLvl()

dispatchPowerLvl(): void

Dispatches power level events. This method might get removed and should not be used outside the SDK.

Returns

void

Deprecated

Defined in

ari/lib/api/media/audio-output.d.ts:139


pause()

pause(): Promise<void>

Pauses the AudioOutput at the SFU and prevents receiving audio packets

Returns

Promise<void>

A promise that resolves when the media is successfully paused.

Defined in

ari/lib/api/media/audio-output.d.ts:123


removeEventListener()

removeEventListener<OdinEventType>(type, callback): void

Type Parameters

OdinEventType extends keyof MediaEvents

Parameters

type: string | OdinEventType

callback: EventListenerOrEventListenerObject | MediaEvents[OdinEventType]

Returns

void

Inherited from

OdinEventTarget.removeEventListener

Defined in

ari/lib/utils/odin-event-target.d.ts:28


resume()

resume(): Promise<void>

Resumes the AudioOutput at the SFU.

Returns

Promise<void>

Defined in

ari/lib/api/media/audio-output.d.ts:127


setVolume()

setVolume(value?): Promise<void>

Sets the volume of the AudioOutput.

The volume value should be between 0 and 2 (inclusive). Values outside this range are clamped.

Parameters

value?: number | OutputVolume

The desired volume setting. It can be a specific volume level or 'muted'.

Returns

Promise<void>

A promise that resolves when the volume adjustment is complete.

Defined in

ari/lib/api/media/audio-output.d.ts:97