AudioSessionState

sealed interface AudioSessionState

Unified state machine for both recording and playback sessions.

This provides a consistent mental model for users working with audio sessions, regardless of whether they're recording or playing back audio.

Inheritors

Types

Link copied to clipboard

Session is actively recording or playing.

Link copied to clipboard

Session completed naturally (recording stopped or playback finished).

Link copied to clipboard
data class Failed(val error: AudioError) : AudioSessionState

Session failed with an error.

Link copied to clipboard
data object Idle : AudioSessionState

Session is idle and ready to start.

Link copied to clipboard

Playback is paused (only applicable to playback sessions).

Properties

Link copied to clipboard

Check if a state allows starting a new operation.

Link copied to clipboard

Check if a state represents an active session.

Link copied to clipboard

Check if a state represents a terminal state (Complete or Failed).