AudioPool

class AudioPool(startPool: List<AudioWrapper>)

Represents a pool of audio tracks that can be managed together.

Parameters

pool

The list of AudioWrapper instances in the pool.

Constructors

Link copied to clipboard
constructor(startPool: List<AudioWrapper>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun changeBalance(balance: Float)

Changes the balance of all audio tracks in the pool by the specified amount.

Link copied to clipboard

Changes the master volume of all audio tracks in the pool by the specified amount.

Link copied to clipboard
fun destroy()

Destroys the audio pool by closing all audio clips.

Link copied to clipboard

Gets the audio track with the specified ID.

Link copied to clipboard

Gets the balance of the first audio track in the pool.

Link copied to clipboard

Gets the balance range (min and max) of the first audio track in the pool.

Link copied to clipboard

Gets the master volume of the first audio track in the pool.

Link copied to clipboard

Gets the master volume range (min and max) of the first audio track in the pool.

Link copied to clipboard

Retrieves the IDs of all currently playing audio tracks in the pool.

Link copied to clipboard

Checks if the audio track with the specified ID is currently playing.

Link copied to clipboard

Checks if all audio tracks in the pool are muted.

Link copied to clipboard

Checks if all audio tracks in the pool are stopped.

Link copied to clipboard
fun merge(other: AudioPool)

Merges this AudioPool with another AudioPool. New audio tracks from the other pool are added to this pool. Duplicate audio tracks (by ID) from the new pool are not added. Tracks from this pool take precedence in case of ID conflicts. Old tracks that do not exist in the other pool are destroyed and removed from this pool.

Link copied to clipboard
fun mute(mute: Boolean)

Mutes or unmutes all audio tracks in the pool.

Link copied to clipboard
fun pause(id: String)

Pauses the audio track with the specified ID.

Link copied to clipboard
fun pauseAll()

Pauses all audio tracks in the pool.

Link copied to clipboard
fun play(id: String)

Plays the audio track with the specified ID.

Link copied to clipboard
fun playAll()

Plays all audio tracks in the pool.

Link copied to clipboard

Resets the balance of all audio tracks in the pool to the default value.

Link copied to clipboard

Resets the master volume of all audio tracks in the pool to the default value.

Link copied to clipboard
fun setBalance(balance: Float)

Sets the balance of all audio tracks in the pool to the specified value.

Link copied to clipboard
fun setMasterVolume(volume: Float)

Sets the master volume of all audio tracks in the pool to the specified value.

Link copied to clipboard
fun stop(id: String)

Stops the audio track with the specified ID.

Link copied to clipboard
fun stopAll()

Stops all audio tracks in the pool.

Link copied to clipboard
fun whileNotFinished(func: () -> Unit = {})

Executes a function while any audio track in the pool is still playing.

fun whileNotFinished(id: String, func: () -> Unit = {})

Executes a function while the audio track with the specified ID is still playing.

Link copied to clipboard
suspend fun whileNotFinishedAsync(func: suspend () -> Unit)

Executes a suspend function while any audio track in the pool is still playing.

suspend fun whileNotFinishedAsync(id: String, func: suspend () -> Unit)

Executes a suspend function while the audio track with the specified ID is still playing.