Respect pause, mute and audio activation
Keep sound under the host's lifecycle controls.
Track independent states
Track host pause and user mute separately. Audio should be audible only when the ready gate has completed, the host is not paused and the player has not muted.
- Subscribe to
pause,resume,muteandunmute. - Initialise the SDK and use
context.mutedas the initial preference. - Prepare audio without starting playback.
- Await
ready()before activating audio. - Apply the combined pause/mute state whenever it changes.
- Stop or suspend engine audio during pause, including long-running music and scheduled notes.
- Dispose audio resources and listeners when replacing a scene or audio subsystem.
Resume must not automatically unmute. Starting a new scene must not create a second copy of background music.
Choose one integration approach
- Use accepted WAV assets through the SDK.
- Use a supported procedural sound library.
- Use the Studio-generated music engine, following its pause and mute instructions.
Pin any library in the manifest. Use the exact engine version’s audio API. For decoded audio, get bytes through llvls.assets.bytes(); do not bypass the SDK with a URL fetch.
Tone.js features that depend on AudioWorklet or microphone access are not compatible with this sandbox. An available library does not imply every feature it contains is permitted.
Test
Play sound, mute, pause, resume, unmute and change tabs in different orders. Listen for lingering music while covered. A muted sample with no audio cannot establish that a real audio integration passes these tests.