AudioBuilder

interface AudioBuilder

A common interface to enable multiplatform audio.

Requires override of audioState, load, play, pause, stop, and release functions.

Inheritors

Properties

Link copied to clipboard
abstract val audioState: StateFlow<AudioState>

common sealed class that provides the state of Audio after initialization

Functions

Link copied to clipboard
abstract fun load(context: Any?)

When overridden, used to load an Audio file when AudioState.NONE.

Link copied to clipboard
abstract fun pause()

When overridden, used when Audio is AudioState.PLAYING to pause the sound to be continued later.

Link copied to clipboard
abstract fun play()

When overridden, used after Audio is initialized with AudioState.READY to play the sound immediately.

Link copied to clipboard
abstract fun release()

When overridden, used when done to clear the Audio object from memory.

Link copied to clipboard
abstract fun stop()

When overridden, used to reset the Audio without reloading from the sound file.