--- id: GAL-49 title: Add background music status: Todo parent: GAL-46 labels: [polish, audio] --- # GAL-49: Add background music Add background music. ## Acceptance criteria - [ ] Music begins on entering `GameState::Playing` and stops/pauses on `GameOver` and `StartMenu`. - [ ] Re-entering `Playing` (after restart) starts exactly one music instance — no overlapping tracks. - [ ] Music volume control independent from SFX channel. - [ ] Looping is seamless (no audible gap on loop). - [ ] Optional: per-stage track override defined in `StageConfig`. ## Integration test hints - State-transition test: `OnEnter(GameState::Playing)` → assert one `BgMusic`-tagged audio entity exists; `OnExit(Playing)` → assert it is gone or paused. - Restart loop test: Playing → GameOver → restart (GAL-55) → Playing; assert exactly one music entity at the end (no duplication). - Headless: ensure the music asset loads under `nix develop` without blocking startup.