AudioByte

Deprecated

AudioByte greedily eats up memory. Switch to the newer channel-based implementation, SoundBoard(context = Any?).

Replace with

SoundBoard(context = null)
actual class AudioByte

Deprecated

AudioByte greedily eats up memory. Switch to the newer channel-based implementation, SoundBoard(context = Any?).

Replace with

SoundBoard(context = null)

Deprecated

AudioByte greedily eats up memory. Switch to the newer channel-based implementation, SoundBoard(context = Any?).

Replace with

SoundBoard(context = null)

Play audio from a local file path or a Compose Resource (String).

Example:

val audioByte: AudioByte = AudioByte() // Create an AudioByte instance
val clickSound: Any = audioByte.load(Res.getUri("files/click.mp3")) // Load the audio file into memory
audioByte.play(clickSound) // Call it whenever you like as needed

Deprecated

AudioByte greedily eats up memory. Switch to the newer channel-based implementation, SoundBoard(context = Any?).

Replace with

SoundBoard(context = null)

Deprecated

AudioByte greedily eats up memory. Switch to the newer channel-based implementation, SoundBoard(context = Any?).

Replace with

SoundBoard(context = null)

Deprecated

AudioByte greedily eats up memory. Switch to the newer channel-based implementation, SoundBoard(context = Any?).

Replace with

SoundBoard(context = null)

Constructors

Link copied to clipboard
actual constructor()
actual constructor()
expect constructor()
actual constructor()
actual constructor()
actual constructor()

Functions

Link copied to clipboard
actual open override fun load(context: Any, localPath: String): Any
actual open fun load(context: Any, localPath: String): Any
expect open override fun load(context: Any, localPath: String): Any

Used to load an Audio file into memory.

actual open override fun load(context: Any, localPath: String): Any
actual open override fun load(context: Any, localPath: String): Any
actual open override fun load(context: Any, localPath: String): Any
Link copied to clipboard
actual open override fun play(item: Any)
actual open fun play(item: Any)
expect open override fun play(item: Any)

Play a loaded sound immediately, without regard for how many times it's already played

actual open override fun play(item: Any)
actual open override fun play(item: Any)
actual open override fun play(item: Any)
Link copied to clipboard
actual open override fun release()
actual open fun release()
expect open override fun release()

Used when done to clear the AudioByte object from memory.

actual open override fun release()
actual open override fun release()
actual open override fun release()