AudioScenePlayer

Loads AudioScenes onto live streams and crossfades between them.

The host opens each layer's AudioStream (file, generator, etc.). This player attaches a mix AudioEffectType.GAIN plus the layer's effects, then uses GainParams.FADE_MS so A → B has no hole or level spike.

AudioScenePlayer(engine).use { player ->
player.transitionTo(sceneA, fadeMs = 0f) { layer ->
engine.openStream(config, callbackFor(layer.id))
}
player.transitionTo(sceneB, fadeMs = 3000f) { layer ->
engine.openStream(config, callbackFor(layer.id))
}
}

Close the player to stop and release every stream and chain it created.

Constructors

Link copied to clipboard
constructor(engine: AudioEngine)

Types

Link copied to clipboard
fun interface LayerSource

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard

Crossfade to scene. Layers with the same SceneLayer.id keep their stream and retarget gain/params. Others fade out and in over fadeMs.