startRecording

fun startRecording(path: String, format: Int)

Starts recording to a file path.

Parameters

path

A writable destination file path.

format

An Android MediaMuxer.OutputFormat value.

Throws

If recording has already started or no data source is registered.


@RequiresApi(value = 26)
fun startRecording(fd: FileDescriptor, format: Int)

Starts recording to a file descriptor. Requires Android 8.0 (API 26) or later.

Parameters

fd

A writable file descriptor accepted by MediaMuxer.

format

An Android MediaMuxer.OutputFormat value.

Throws

If recording has already started or no data source is registered.