AudioWrapper

data class AudioWrapper(val id: String, val clip: Clip, val modifier: AudioModifier = AudioModifier())

A wrapper for an audio Clip, providing methods to control playback and audio properties.

See also

Throws

if the clip cannot be opened.

Constructors

Link copied to clipboard
constructor(id: String, clip: Clip, modifier: AudioModifier = AudioModifier())

Creates an AudioWrapper with the specified id, clip, and modifier.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
private val clip: Clip

The Clip object representing the audio data.

Link copied to clipboard
val id: String

The identifier for the audio clip.

Link copied to clipboard
private val loopEnd: Int
Link copied to clipboard
private val loopStart: Int
Link copied to clipboard

The AudioModifier containing playback settings.

Functions

Link copied to clipboard
fun close()

Closes the audio clip, releasing any system resources associated with it.

Link copied to clipboard
Link copied to clipboard

Checks if the audio clip is currently playing.

Link copied to clipboard
fun pause()

Pauses playback of the audio clip.

Link copied to clipboard
fun play()

Starts playback of the audio clip. If the clip is set to loop, it will loop continuously.

Link copied to clipboard
fun stop()

Stops playback of the audio clip. Depending on the modifier settings, it may reset to the start position or close the clip.