AudioError

sealed class AudioError : Throwable

Sealed hierarchy representing all possible audio-related errors.

Using sealed classes provides exhaustive when-expressions and clear error categorization.

Note: Simple error types use classes (not objects) to ensure proper stack traces are captured when the error is created.

Inheritors

Types

Link copied to clipboard

A playback session is already active.

Link copied to clipboard

A recording is already in progress.

Link copied to clipboard
object Companion
Link copied to clipboard
data class DeviceError(val errorMessage: String, val errorCause: Throwable? = null) : AudioError

A device-level error occurred during recording or playback.

Link copied to clipboard
data class DeviceNotFound(val deviceId: String? = null) : AudioError

The requested audio device was not found or is unavailable.

Link copied to clipboard

The current platform does not support pinning a specific input/output device.

Link copied to clipboard
data class FormatNotSupported(val format: AudioFormat? = null) : AudioError

The requested audio format is not supported by the device.

Link copied to clipboard

No recording data available.

Link copied to clipboard

Kodio has not been initialized. Call Kodio.initialize() first.

Link copied to clipboard

Microphone or audio permission was denied by the user.

Link copied to clipboard
data class Unknown(val originalCause: Throwable) : AudioError

An unknown or unexpected error occurred.

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
expect open val message: String?