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))
}
}Content copied to clipboard
Close the player to stop and release every stream and chain it created.
Functions
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.