startAudioRecording

abstract fun startAudioRecording(recordingName: String, amplitudePollingInterval: Long = 100, override: Boolean = true): 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 ChatError 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 OnMaxAmplitudeSampled emits a new value.

override

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


abstract fun startAudioRecording(recordingFile: File, amplitudePollingInterval: Long = 100): 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 OnMaxAmplitudeSampled emits a new value.