startAudioRecording

open override fun startAudioRecording(recordingName: String, amplitudePollingInterval: Long, override: Boolean): Result<File>

Creates a File internally and starts recording. Calling the function again after a recording has already been started will reset the recording process.

Return

The File to which the recording will be stored wrapped inside a Result if recording has started successfully. Returns a Error wrapped inside a Result if the action had failed.

Parameters

recordingName

The file name the recording will be stored under.

amplitudePollingInterval

Dictates how often the recorder is polled for the latest max amplitude and how often onMaxAmplitudeSampledListener emits a new value.

override

Determines if the new recording file should override one with the same name, if it exists.


open override fun startAudioRecording(recordingFile: File, amplitudePollingInterval: Long): Result<Unit>

Prepares the given recordingFile and starts recording. Calling the function again after a recording has already been started will reset the recording process.

Return

A Unit wrapped inside a Result if recording has started successfully. Returns a ChatError wrapped inside Result if the action had failed.

Parameters

recordingFile

The File the audio will be saved to once the recording stops.

amplitudePollingInterval

Dictates how often the recorder is polled for the latest max amplitude and how often onMaxAmplitudeSampledListener emits a new value.