wobblyhead hg > minor_monsters
annotate doc/sound.md @ 17:fe680946164b
reorganised repo
| author | ark |
|---|---|
| date | 2026-10-20 00:12 +0200 |
| parents | 2c4fed8baed9 |
| children | 85d23328a215 |
| rev | line source |
|---|---|
| 0 | 1 sound |
| 2 ----- | |
| 3 | |
| 4 | 4 events with a voice recording play the recording. the others play |
| 5 placeholder beeps, generated in the browser (web audio oscillator, a few notes | |
| 6 each), until a recording arrives. | |
| 0 | 7 |
| 8 | |
| 9 events | |
| 10 ------ | |
| 11 | |
| 4 | 12 the event name is the name of its recordings and its entry in [sound.event] |
| 13 in config/game.toml. | |
| 14 | |
| 15 | event | name | notes | | |
| 16 |----------------------|-------------------|-------| | |
| 17 | t0 attack | t0_attack | recorded, 4 variants | | |
| 18 | t1 shot | t1_shot | recorded, 6 variants | | |
| 19 | t2 shot | t2_shot | recorded, 4 variants | | |
| 20 | t3 shot | t3_shot | recorded, 7 variants | | |
| 21 | monster hit | monster_hit | frequent; keep short or play only some of them | | |
| 22 | monster enters map | monster_enter | recorded, 3 variants. every monster for now; to playtest | | |
| 23 | monster dies | monster_die | recorded, 4 variants | | |
| 24 | monster reaches exit | monster_exit | recorded. a heart is lost | | |
| 25 | boss appears | boss_enter | recorded | | |
| 26 | boss reaches exit | boss_exit | recorded | | |
| 27 | boss dies | boss_die | recorded | | |
| 28 | coins arrive | coins_arrive | at most one per short interval | | |
| 29 | wave starts | wave_start | | | |
| 30 | early start bonus | early_bonus | | | |
| 31 | tower built | tower_built | | | |
| 6 | 32 | tower upgraded | tower_upgraded | | |
| 33 | tower sold | tower_sold | | | |
| 4 | 34 | placement refused | placement_refused | no legal spot within reach | |
| 35 | button tap | button_tap | | | |
| 36 | map won | map_won | recorded | | |
| 37 | map lost | map_lost | recorded | | |
| 0 | 38 |
| 39 several recordings per event are allowed; the game picks one at random. | |
| 40 | |
| 4 | 41 the map won sound waits until a boss or monster death sound still playing has |
| 42 ended, and map lost waits for the last exit sound. the boss wave may not stay | |
| 43 the end of a map, so boss_die and map_won are separate sounds. | |
| 44 | |
| 45 per event, the config sets a volume, an optional least time between two | |
| 46 plays (plays in between are dropped) and the placeholder beep. | |
| 47 | |
| 0 | 48 |
| 49 recordings | |
| 50 ---------- | |
| 51 | |
| 52 - recorded on any device, supplied in any common format | |
| 4 | 53 - art/sound_sources/ holds the recordings as supplied, named after the event. |
| 54 a recording may hold several variants with pauses between them | |
| 55 - tools/cut_sounds.py turns them into game sounds in art/sounds/. it is run | |
| 56 by hand after a recording changes, not by the build, because it needs | |
| 57 ffmpeg. it lists the number of variants per recording and splits those | |
| 58 recordings at their longest pauses, into NAME_1, NAME_2 and so on. it | |
| 59 trims silence, filters low rumble, fades the ends and brings every sound to | |
| 60 the same peak level. the output is mono mp3, which desktop browsers and | |
| 61 tablets (including safari) play | |
| 17 | 62 - the build embeds art/sounds/ as base64 in www/data/sounds.js. see |
| 4 | 63 architecture.md for why |
| 0 | 64 |
| 6 | 65 browsers only play sound after the first user interaction. the play button on |
| 66 the splash screen starts the sound. | |
| 0 | 67 |
|
8
2c4fed8baed9
art update, persistent sound setting, tower selling as double action
ark
parents:
6
diff
changeset
|
68 the sound button in the top bar switches sound on and off. the choice is |
|
2c4fed8baed9
art update, persistent sound setting, tower selling as double action
ark
parents:
6
diff
changeset
|
69 stored in the browser (architecture.md, persistence). until the player first |
|
2c4fed8baed9
art update, persistent sound setting, tower selling as double action
ark
parents:
6
diff
changeset
|
70 uses it, the enabled setting in [sound] applies. |
