From 0da87269df47b6278869a214e9b51703e0c3e43a Mon Sep 17 00:00:00 2001 From: stanislaw-ch Date: Wed, 11 Nov 2026 21:30:50 +0100 Subject: [PATCH] docs: clarify that sound and music start muted --- modules/music/README.md | 2 ++ modules/music/src/music.library.ts | 2 ++ modules/sound/README.md | 2 ++ modules/sound/src/sound.library.ts | 2 ++ 4 files changed, 8 insertions(+) diff --git a/modules/music/README.md b/modules/music/README.md index ee459623..06933b20 100644 --- a/modules/music/README.md +++ b/modules/music/README.md @@ -51,6 +51,8 @@ public override async __run(ctx: Context): Promise { } ``` +Music starts muted. Call `ctx.music.mute()` once to unmute it. + Call `ctx.music.mute()` to toggle the muted state of every loaded track. `play` throws `NfNotFound` when the given key was never loaded. ## Links diff --git a/modules/music/src/music.library.ts b/modules/music/src/music.library.ts index 58c01402..257a389a 100644 --- a/modules/music/src/music.library.ts +++ b/modules/music/src/music.library.ts @@ -10,6 +10,8 @@ import type { MusicContextApi } from "./music-context.type"; * Manages a collection of named `HTMLAudioElement` instances and ensures * only one track plays at a time — unlike `SoundLibrary`, starting a new * track pauses whichever one was playing. + * + * Music starts muted. Call `mute()` once to unmute it. */ export class MusicLibrary extends Library implements EditorAwareLibrary { readonly key = defineLibraryKey("music"); diff --git a/modules/sound/README.md b/modules/sound/README.md index 68b292d3..51045903 100644 --- a/modules/sound/README.md +++ b/modules/sound/README.md @@ -51,6 +51,8 @@ public override async __run(ctx: Context): Promise { } ``` +Sound effects start muted. Call `ctx.sound.mute()` once to unmute them. + Call `ctx.sound.mute()` to toggle the muted state of every loaded sound effect. `play` throws `NfNotFound` when the given key was never loaded. ## Links diff --git a/modules/sound/src/sound.library.ts b/modules/sound/src/sound.library.ts index 1b10c48d..9f6470dc 100644 --- a/modules/sound/src/sound.library.ts +++ b/modules/sound/src/sound.library.ts @@ -10,6 +10,8 @@ import type { SoundContextApi } from "./sound-context.type"; * Manages a collection of named `HTMLAudioElement` instances. Load sounds * with `load` and trigger playback with `play`. Unlike `MusicLibrary`, * multiple sounds may overlap — there's no single-track exclusivity. + * + * Sound effects start muted. Call `mute()` once to unmute them. */ export class SoundLibrary extends Library implements EditorAwareLibrary { readonly key = defineLibraryKey("sound");