StreamMediaRecorder

A media recording interface, designed to simplify using MediaRecorder.

Inheritors

Types

Link copied to clipboard

A functional interface used for listening to updated in the duration of the currently active recording.

Link copied to clipboard
fun interface OnErrorListener

A functional interface used for listening to error events dispatched by the MediaRecorder internally used by StreamMediaRecorder.

Link copied to clipboard
fun interface OnInfoListener

A functional interface used for listening to info events dispatched by the MediaRecorder internally used by StreamMediaRecorder.

Link copied to clipboard
fun interface OnMaxAmplitudeSampled

A functional interface used for emitting max amplitude readings during recording.

Link copied to clipboard

A functional interface used for listening to StreamMediaRecorder state changes.

Link copied to clipboard
fun interface OnRecordingStarted

A functional interface used for notifying after the recording has started successfully.

Link copied to clipboard
fun interface OnRecordingStopped

A functional interface used for notifying after the recording has stopped.

Functions

Link copied to clipboard
abstract fun deleteRecording(recordingFile: File): Result<Unit>

Deleted the recording to the file provided by recordingFile.

Link copied to clipboard
abstract fun release()

Releases the MediaRecorder used by StreamMediaRecorder.

Link copied to clipboard

Sets an error listener.

Link copied to clipboard

Sets an info listener.

Link copied to clipboard
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.

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.

Link copied to clipboard
abstract fun stopRecording(): Result<RecordedMedia>

Stops recording and saves the recording to the file provided by startAudioRecording.