AudioEngine

An audio engine playing a list of items.

Types

Link copied to clipboard
interface Error : Error

Marker interface for the errors that the AudioEngine returns.

Link copied to clipboard
data class Playback(val state: AudioEngine.State, val playWhenReady: Boolean, val index: Int, val offset: Duration, val buffered: Duration?)

State of the playback.

Link copied to clipboard
sealed class State

State of the player.

Properties

Link copied to clipboard
abstract val playback: StateFlow<AudioEngine.Playback>

Current state of the playback.

Link copied to clipboard
abstract val settings: StateFlow<S>

Functions

Link copied to clipboard
abstract fun asPlayer(): Player

Adapts this engine to the media3 Player interface.

Link copied to clipboard
abstract fun close()

Closes the player.

Link copied to clipboard
abstract fun pause()

Pauses the playback.

Link copied to clipboard
abstract fun play()

Resumes the playback at the current location.

Link copied to clipboard
abstract fun skip(duration: Duration)

Skips duration either forward or backward if duration is negative.

Link copied to clipboard
abstract fun skipBackward()

Skips backward a small increment.

Link copied to clipboard
abstract fun skipForward()

Skips forward a small increment.

Link copied to clipboard
abstract fun skipTo(index: Int, offset: Duration)

Skips to offset in the item at index.

Link copied to clipboard
abstract fun submitPreferences(preferences: P)