SpeakerAudioDestination class

Represents the speaker playback audio destination, which only works in browser. Note: the SDK will try to use Media Source Extensions to play audio. Mp3 format has better supports on Microsoft Edge, Chrome and Safari (desktop), so, it's better to specify mp3 format for playback.

Constructors

SpeakerAudioDestination(string)

Properties

currentTime

Gets the current play audio offset.

format
internalAudio
isClosed
onAudioEnd
onAudioStart
volume

Methods

close(() => void, (error: string) => void)
id()
mute()
pause()

Pauses the audio playing

resume(() => void, (error: string) => void)

Resumes the audio playing

unmute()
write(ArrayBuffer, () => void, (error: string) => void)

Constructor Details

SpeakerAudioDestination(string)

new SpeakerAudioDestination(audioDestinationId?: string)

Parameters

audioDestinationId

string

Property Details

currentTime

Gets the current play audio offset.

number currentTime

Property Value

number

The current play audio offset, in second

format

void format

Property Value

void

internalAudio

HTMLAudioElement internalAudio

Property Value

HTMLAudioElement

isClosed

boolean isClosed

Property Value

boolean

onAudioEnd

onAudioEnd: (sender: IPlayer) => void

Property Value

(sender: IPlayer) => void

onAudioStart

onAudioStart: (sender: IPlayer) => void

Property Value

(sender: IPlayer) => void

volume

number volume

Property Value

number

Method Details

close(() => void, (error: string) => void)

function close(cb?: () => void, err?: (error: string) => void)

Parameters

cb

() => void

err

(error: string) => void

id()

function id(): string

Returns

string

mute()

function mute()

pause()

Pauses the audio playing

function pause()

resume(() => void, (error: string) => void)

Resumes the audio playing

function resume(cb?: () => void, err?: (error: string) => void)

Parameters

cb

() => void

err

(error: string) => void

unmute()

function unmute()

write(ArrayBuffer, () => void, (error: string) => void)

function write(buffer: ArrayBuffer, cb?: () => void, err?: (error: string) => void)

Parameters

buffer

ArrayBuffer

cb

() => void

err

(error: string) => void