wobblyhead hg > minor_monsters
diff doc/sound.md @ 32:85d23328a215 0.10.0
added intro music, logic for browser audio triggering on splash screen
| author | ark |
|---|---|
| date | 2026-10-20 18:39 +0200 |
| parents | fe680946164b |
| children |
line wrap: on
line diff
--- a/doc/sound.md Tue Oct 20 17:58:10 2026 +0200 +++ b/doc/sound.md Tue Oct 20 18:39:22 2026 +0200 @@ -35,6 +35,7 @@ | button tap | button_tap | | | map won | map_won | recorded | | map lost | map_lost | recorded | +| splash screen music | intro | recorded, loops while the splash screen shows | several recordings per event are allowed; the game picks one at random. @@ -59,11 +60,22 @@ trims silence, filters low rumble, fades the ends and brings every sound to the same peak level. the output is mono mp3, which desktop browsers and tablets (including safari) play +- the script can drop the start of a recording up to a set time, and add a + pause of silence after a sound that loops. intro loses its first 3 s, + which hold a burp before the music, and gets 0.3 s of silence at the end - the build embeds art/sounds/ as base64 in www/data/sounds.js. see architecture.md for why -browsers only play sound after the first user interaction. the play button on -the splash screen starts the sound. +browsers only play sound after the first user interaction. on the first +splash screen after loading, a sound button covers the play button. it +pulses with a red glow, like an armed sell button. tapping it starts the +sound and the intro music, and uncovers the play button. when sound was +switched off in an earlier visit, there is no sound button: the play button +shows at once and starts the sound as before, and there is no music. + +the intro loops until the play button is tapped, then fades out over the +music_fade setting in [sound]. the splash screen that follows a won game +plays the intro at once, as sound is already running. the sound button in the top bar switches sound on and off. the choice is stored in the browser (architecture.md, persistence). until the player first
