AudioPreview

The AudioPreview model allows the local participant to test different capture modes and voice fonts before a conference. The model is supported only in SDK 3.10 and later.

Accessors

captureMode

captureMode: AudioCaptureMode

Sets an audio capture mode for the audio preview.

Returns: AudioCaptureMode


status

status: AudioPreviewStatus

Gets the recording status.

Returns: AudioPreviewStatus


callback

callback((status: AudioPreviewStatus-> Unit)? = null)

A callback called by the SDK when the recording status changes.

Parameters:

NameTypeDescription
statusAudioPreviewStatusThe recording status.

Methods

cancel

cancel()

🚧

Note

This method is replaced with the stop method in SDK 3.10.1.

Cancels recording or playing an audio sample.

Returns: Bool


play

play(loop: Boolean)

Plays back the recorded audio sample. To test how your audio sounds while using different capture modes and voice fonts, set the setCaptureMode method to a preferred setting before using the method.

Parameters:

NameTypeDescription
loopbooleanA boolean that indicates wether the SDK should play the recorded audio in a loop.

record

record(duration: Int)

Starts recording an audio sample if no recording is in progress. This method requires the Android AudioRecord permission. Calling this method without the permission granted results in the promise to reject the call.

Parameters:

NameTypeDescription
durationIntThe preferred recording duration that ranges from 0 to 5, in seconds.

release

release()

Releases the internal memory and restarts the audio session configuration.

Returns: Bool


stop

stop()

Stops recording or playing an audio sample. This method is available in SDK 3.10.1 and later.

Returns: Bool