AudioRecordingActions

data class AudioRecordingActions(val onStartRecording: () -> Unit, val onHoldRecording: (Offset) -> Unit, val onLockRecording: () -> Unit, val onCancelRecording: () -> Unit, val onDeleteRecording: () -> Unit, val onStopRecording: () -> Unit, val onConfirmRecording: () -> Unit, val onToggleRecordingPlayback: () -> Unit, val onRecordingSliderDragStart: (Float) -> Unit, val onRecordingSliderDragStop: (Float) -> Unit)

Actions that can be performed during an audio recording session.

Each property maps a user gesture or button tap to a handler. Override individual actions via copy to customise behaviour while keeping the rest at their defaults.

Constructors

Link copied to clipboard
constructor(onStartRecording: () -> Unit, onHoldRecording: (Offset) -> Unit, onLockRecording: () -> Unit, onCancelRecording: () -> Unit, onDeleteRecording: () -> Unit, onStopRecording: () -> Unit, onConfirmRecording: () -> Unit, onToggleRecordingPlayback: () -> Unit, onRecordingSliderDragStart: (Float) -> Unit, onRecordingSliderDragStop: (Float) -> Unit)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Discards the recording via the swipe-to-cancel gesture. Invoked when the user drags past the cancel threshold during RecordingState.Hold. Transitions to RecordingState.Idle.

Link copied to clipboard

Finalises the recording. Depending on configuration, this either sends the recording immediately or attaches it to the composer for manual sending. Invoked on finger release (when not locked) or when tapping the confirm button in RecordingState.Locked / RecordingState.Overview.

Link copied to clipboard

Discards the recording via the delete button. Invoked when the user taps the trash icon in RecordingState.Locked or RecordingState.Overview. Transitions to RecordingState.Idle.

Link copied to clipboard

Updates the drag offset while the user holds the record button. The Offset represents the constrained drag delta from the initial press position (negative x = cancel direction, negative y = lock direction). Only meaningful in RecordingState.Hold.

Link copied to clipboard

Locks the recording so it continues hands-free. Transitions from RecordingState.Hold to RecordingState.Locked.

Link copied to clipboard

Called when the user begins dragging the playback slider. Pauses playback. The Float is the playback progress at the drag start point (0..1).

Link copied to clipboard

Called when the user releases the playback slider. Seeks playback to the given progress. The Float is the target progress (0..1).

Link copied to clipboard

Begins a new recording. Transitions from RecordingState.Idle to RecordingState.Hold. Ignored when the current state is not RecordingState.Idle.

Link copied to clipboard

Stops the active microphone recording. Transitions from RecordingState.Locked to RecordingState.Overview, where the user can review the waveform before confirming.

Link copied to clipboard

Toggles play / pause of the recorded audio. Only meaningful in RecordingState.Overview.