LocalAudioStream class

Represents a local audio stream for a local michrophone device

Constructors

LocalAudioStream(AudioDeviceInfo)

Create a local audio stream

LocalAudioStream(MediaStream)

Properties

mediaStreamType

Get the media stream type for this LocalAudioStream

source

Get the current audio source for this LocalAudioStream

Methods

dispose()

Need to call dispose when the LocalAudioStream object is not provided in the CallOptions

feature<TFeature>(AudioStreamFeatureFactory<TFeature>)

Retrieves an initialized and memoized Feature object with extended API. Check the object Features.* for all available extended features in this package. Currently supported - Features.AudioEffects

getMediaStream()

Get media stream.

getVolume()

Need to call getVolume on audioSourceChanged to get a new volume object binded to new source

off("audioSourceChanged", AudioSourceChangedEvent)

Unsubscribe function for audioSourceChanged event.

on("audioSourceChanged", AudioSourceChangedEvent)

Subscribe function for audioSourceChanged event.

setMediaStream(MediaStream)

Switch to use a different audio stream

switchSource(AudioDeviceInfo)

Switch to use a different audio source

Constructor Details

LocalAudioStream(AudioDeviceInfo)

Create a local audio stream

new LocalAudioStream(source: AudioDeviceInfo)

Parameters

source
AudioDeviceInfo

The mic or media stream source to use.

LocalAudioStream(MediaStream)

new LocalAudioStream(source: MediaStream)

Parameters

source

MediaStream

Property Details

mediaStreamType

Get the media stream type for this LocalAudioStream

MediaStreamType mediaStreamType

Property Value

source

Get the current audio source for this LocalAudioStream

AudioDeviceInfo source

Property Value

Method Details

dispose()

Need to call dispose when the LocalAudioStream object is not provided in the CallOptions

function dispose()

feature<TFeature>(AudioStreamFeatureFactory<TFeature>)

Retrieves an initialized and memoized Feature object with extended API. Check the object Features.* for all available extended features in this package. Currently supported - Features.AudioEffects

function feature<TFeature>(factory: AudioStreamFeatureFactory<TFeature>): TFeature

Parameters

factory

AudioStreamFeatureFactory<TFeature>

The factory for the audio stream feature constructor that provides an extended API

Returns

TFeature

getMediaStream()

Get media stream.

function getMediaStream(): Promise<MediaStream>

Returns

Promise<MediaStream>

getVolume()

Need to call getVolume on audioSourceChanged to get a new volume object binded to new source

function getVolume(): Promise<Volume>

Returns

Promise<Volume>

off("audioSourceChanged", AudioSourceChangedEvent)

Unsubscribe function for audioSourceChanged event.

function off(event: "audioSourceChanged", listener: AudioSourceChangedEvent)

Parameters

event

"audioSourceChanged"

event name.

listener
AudioSourceChangedEvent

callback fn that was used to subscribe to this event.

on("audioSourceChanged", AudioSourceChangedEvent)

Subscribe function for audioSourceChanged event.

function on(event: "audioSourceChanged", listener: AudioSourceChangedEvent)

Parameters

event

"audioSourceChanged"

event name.

listener
AudioSourceChangedEvent

callback fn that will be called when the audio source will change.

setMediaStream(MediaStream)

Switch to use a different audio stream

function setMediaStream(source: MediaStream): Promise<void>

Parameters

source

MediaStream

The new audio stream to use.

Returns

Promise<void>

switchSource(AudioDeviceInfo)

Switch to use a different audio source

function switchSource(source: AudioDeviceInfo): Promise<void>

Parameters

source
AudioDeviceInfo

The new audio source to use.

Returns

Promise<void>