LocalAudioStream class
Represents a local audio stream for a local michrophone device
Constructors
Local |
Create a local audio stream |
Local |
Properties
media |
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>(Audio |
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 |
get |
Get media stream. |
get |
Need to call getVolume on audioSourceChanged to get a new volume object binded to new source |
off("audio |
Unsubscribe function for audioSourceChanged event. |
on("audio |
Subscribe function for audioSourceChanged event. |
set |
Switch to use a different audio stream |
switch |
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>