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.
Methods
status
▸ status(): Promise
<AudioPreviewStatus>
Gets the recording status.
Returns
Promise
<AudioPreviewStatus>
getCaptureMode
▸ getCaptureMode(): Promise
<AudioCaptureModeOptions>
Gets an audio capture mode for the audio preview.
Returns
Promise
<AudioCaptureModeOptions>
setCaptureMode
▸ setCaptureMode(captureMode
): Promise
<void
>
Sets an audio capture mode for the audio preview.
Parameters
Name | Type |
---|---|
captureMode | AudioCaptureModeOptions |
Returns
Promise
<void
>
play
▸ play(loop
): Promise
<void
>
Plays back the recorded audio sample. To test how your audio sounds while using different capture modes and voice fonts, set the captureMode to a preferred setting before using the method.
Parameters
Name | Type | Description |
---|---|---|
loop | boolean | A boolean that indicates wether the SDK should play the recorded audio in a loop. |
Returns
Promise
<void
>
record
▸ record(duration
): Promise
<void
>
Starts recording an audio sample if no recording is in progress.
Parameters
Name | Type | Description |
---|---|---|
duration | number | The preferred recording duration, in seconds. |
Returns
Promise
<void
>
release
▸ release(): Promise
<void
>
Releases the internal memory and restarts the audio session configuration.
Returns
Promise
<void
>
stop
▸ stop(): Promise
<boolean
>
Stops recording or playing an audio sample.
Returns
Promise
<boolean
>
Event handlers
onStatusChanged
▸ onStatusChanged(handler
): UnsubscribeFunction
Parameters
Name | Type |
---|---|
handler | (data : AudioPreviewStatusChangedEventType) => void |
Returns
Updated 4 months ago