LocalAudio

The LocalAudio model allows enabling and disabling the local participant's audio as well as setting and checking the capture mode and comfort noise level.

This model is supported only in SDK 3.7 and later.

Methods

applyConstraints

applyConstraints(constraints: MediaTrackConstraints): Promise

Applies a set of audio constraints to an audio track to allow setting ideal values and acceptable value ranges of constrainable properties of the track, such as echo cancellation and noise suppression. The method does not allow setting the deviceId and groupId constraints. If the required constraints are too strict to find a match during a track configuration attempt, the promise is rejected with the OverconstrainedError. We recommend using this method for applying constraints; MediaStreamTrack.applyconstraints() may not work as expected.

The method is available only for users who use the Opus codec. Calling this method by listeners or participants who use the Dolby Voice Codec triggers the UnsupportedError. Calling the method outside of a conference or when the local audio track is not started causes a rejection of a promise and an error.

The method may require a few seconds to become effective because some constraints of an audio track must be recreated.

Parameters:

NameTypeDescription
constraints?MediaTrackConstraints-

Returns: Promise


getCaptureMode

getCaptureMode(): Promise<AudioCaptureModeOptions>

Returns the local participant's audio capture mode in Dolby Voice conferences.

Returns: Promise<AudioCaptureModeOptions>


setCaptureMode

setCaptureMode(options: AudioCaptureModeOptions): Promise<void>

Sets the local participant's audio capture mode in Dolby Voice conferences.

Parameters:

NameTypeDescription
optionsAudioCaptureModeOptionsThe preferred audio capture mode and additional settings for the selected mode.

Returns: Promise<void>


getComfortNoiseLevel

getComfortNoiseLevel(): Promise<ComfortNoiseLevel>

Returns the comfort noise level setting for output devices in Dolby Voice conferences.

Returns: Promise<ComfortNoiseLevel>


setComfortNoiseLevel

setComfortNoiseLevel(level: ComfortNoiseLevel): Promise<void>

Sets the comfort noise level for output devices in Dolby Voice conferences.

Parameters:

NameTypeDescription
levelComfortNoiseLevelThe comfort noise level.

Returns: Promise<void>


start

start(): Promise<any>

Enables the local participant's audio and sends the audio to a conference. This method is not available for listeners and triggers the UnsupportedError.

The SDK automatically manages audio rendering, which means that the application does not need to implement its own element. The application can use the selectAudioInput and selectAudioOutput methods to select the proper audio input and output devices.

The start method requires a few seconds to become effective.

Returns: Promise<any>


stop

stop(): Promise<any>

Disables the local participant's audio and stops sending the audio to a conference. This method is not available for listeners and triggers the UnsupportedError.

The stop method requires a few seconds to become effective.

Returns: Promise<any>