M003: Audio system (SFX and music) #3

Closed
opened 2026-05-08 13:52:25 +00:00 by Mark · 4 comments
Owner

Add audio to the game:

  • Background music per theme (jungle, temple, cave, volcano)
  • SFX: marble rolling, jump, collect power-up, obstacle hit, level complete
  • Volume controls in settings
  • Mute toggle
  • Use Howler.js or Web Audio API
Add audio to the game: - Background music per theme (jungle, temple, cave, volcano) - SFX: marble rolling, jump, collect power-up, obstacle hit, level complete - Volume controls in settings - Mute toggle - Use Howler.js or Web Audio API
Author
Owner

⏸ Needs Decision

Blocking factors:

  • Didn't meet auto-approve criteria — scope=medium, risk=low, spec=aligned

Scope: medium Risk: low Spec: aligned Type: feature
Summary: Add an audio system with theme-based background music, game event SFX, volume controls, and mute toggle using Howler.js or Web Audio API.
Suggestion: Create a modular AudioManager class using Howler.js. Define audio event SFX keys and theme music mappings in a config object, inject via singleton or React context, add volume/mute UI to settings, and lazy-load assets to avoid startup delay.
Rationale: Scope is medium because it requires a new audio module plus integration points (settings UI, game event hooks, asset loading) touching 5-10 files but no existing core logic changes. Risk is low since it's purely additive — no physics, gameplay, or data code is modified. Spec alignment is strong: the existing level themes (Jungle Temple, Crystal Cave, Volcano Core) map directly to the music tracks requested, and game events (jump, boost, collect, obstacle hit) already exist in code as integration hooks.

Action: Review each blocking factor above. Remove blocked:needs-decision label to route back to triage.

## ⏸ Needs Decision **Blocking factors:** - **Didn't meet auto-approve criteria** — scope=medium, risk=low, spec=aligned --- **Scope:** medium **Risk:** low **Spec:** aligned **Type:** feature **Summary:** Add an audio system with theme-based background music, game event SFX, volume controls, and mute toggle using Howler.js or Web Audio API. **Suggestion:** Create a modular AudioManager class using Howler.js. Define audio event SFX keys and theme music mappings in a config object, inject via singleton or React context, add volume/mute UI to settings, and lazy-load assets to avoid startup delay. **Rationale:** Scope is medium because it requires a new audio module plus integration points (settings UI, game event hooks, asset loading) touching 5-10 files but no existing core logic changes. Risk is low since it's purely additive — no physics, gameplay, or data code is modified. Spec alignment is strong: the existing level themes (Jungle Temple, Crystal Cave, Volcano Core) map directly to the music tracks requested, and game events (jump, boost, collect, obstacle hit) already exist in code as integration hooks. **Action:** Review each blocking factor above. Remove `blocked:needs-decision` label to route back to triage.
Author
Owner

GSD pipeline blocked at IMPLEMENT: API call failed after 3 retries.
]11;?\API call failed after 3 retries: HTTP 404: 404 page not found

GSD pipeline blocked at IMPLEMENT: API call failed after 3 retries. ]11;?\API call failed after 3 retries: HTTP 404: 404 page not found
Mark closed this issue 2026-06-16 18:11:46 +00:00
Mark 2026-06-16 18:11:53 +00:00
Author
Owner

Janitor Overseer — Status: Re-opened (work incomplete)

The fixit pipeline died unexpectedly during the Bugfix phase. The audio implementation is partially complete in a852ad0 and b51e2d6 (commits pushed):

Done:

  • app/src/lib/audio.ts (Web Audio implementation)
  • Root package.json delegating test/lint/typecheck to app/
  • SFX hooks for countdown tick, race-start "go", jump (normal + wall-jump), marble rolling
  • State fields _lastRollSfx / _lastCountdownStep

Still TODO (next pipeline run):

  • Music playback per level theme (jungle/temple/cave/volcano)
  • Settings UI in Play.tsx (soundEnabled, musicVolume, sfxVolume)
  • Settings wiring in defaultSettings
  • audio.updateSettings() calls in Play.tsx
  • Remaining SFX cues: collect coin/gem, powerup, obstacle hit/death, checkpoint, level complete
  • Tests for audio.ts
  • Resolve the other type errors flagged by tsc --noEmit (GameSettings re-export, DEFAULT_GAME_PROGRESS, etc.)

The work is committed and pushed. This issue is re-labeled triage-approved for the next pipeline run.

## Janitor Overseer — Status: Re-opened (work incomplete) The fixit pipeline died unexpectedly during the Bugfix phase. The audio implementation is **partially complete** in `a852ad0` and `b51e2d6` (commits pushed): **Done:** - `app/src/lib/audio.ts` (Web Audio implementation) - Root `package.json` delegating test/lint/typecheck to `app/` - SFX hooks for countdown tick, race-start "go", jump (normal + wall-jump), marble rolling - State fields `_lastRollSfx` / `_lastCountdownStep` **Still TODO (next pipeline run):** - Music playback per level theme (jungle/temple/cave/volcano) - Settings UI in Play.tsx (soundEnabled, musicVolume, sfxVolume) - Settings wiring in `defaultSettings` - `audio.updateSettings()` calls in Play.tsx - Remaining SFX cues: collect coin/gem, powerup, obstacle hit/death, checkpoint, level complete - Tests for `audio.ts` - Resolve the other type errors flagged by `tsc --noEmit` (GameSettings re-export, DEFAULT_GAME_PROGRESS, etc.) The work is committed and pushed. This issue is re-labeled `triage-approved` for the next pipeline run.
Mark closed this issue 2026-06-16 18:15:25 +00:00
Author
Owner

Update: type errors resolved, build clean

Follow-up to the earlier comment. The janitor overseer resolved the type errors that were blocking tsc -b:

  • Re-export GameSettings from @/types/game
  • Add DEFAULT_GAME_PROGRESS / LevelProgress imports in Play.tsx
  • Cast through unknown for the Record<string, unknown> -> StoredGameProgress coercion in gameProgressStorage.ts
  • Add soundEnabled / musicVolume / sfxVolume to the three defaultSettings / mockSettings blocks (controls.test.ts, engine.test.ts, Play.tsx)

Commit: fdd13b7. npm test (432/432) and npm run build (tsc -b && vite build) both pass.

Still TODO (next pipeline run):

  • Music playback per level theme (jungle/temple/cave/volcano)
  • Settings UI in Play.tsx (soundEnabled toggle, musicVolume slider, sfxVolume slider)
  • Wire defaultSettings -> audio.updateSettings() on game start / settings change
  • Remaining SFX cues: collect coin/gem, powerup, obstacle hit/death, checkpoint, level complete
  • Tests for audio.ts (no-op safety, settings wiring)

Issue is re-labeled triage-approved for the next pipeline run.

## Update: type errors resolved, build clean Follow-up to the earlier comment. The janitor overseer resolved the type errors that were blocking `tsc -b`: - Re-export `GameSettings` from `@/types/game` - Add `DEFAULT_GAME_PROGRESS` / `LevelProgress` imports in `Play.tsx` - Cast through `unknown` for the `Record<string, unknown> -> StoredGameProgress` coercion in `gameProgressStorage.ts` - Add `soundEnabled` / `musicVolume` / `sfxVolume` to the three `defaultSettings` / `mockSettings` blocks (controls.test.ts, engine.test.ts, Play.tsx) Commit: fdd13b7. `npm test` (432/432) and `npm run build` (`tsc -b && vite build`) both pass. **Still TODO (next pipeline run):** - Music playback per level theme (jungle/temple/cave/volcano) - Settings UI in Play.tsx (soundEnabled toggle, musicVolume slider, sfxVolume slider) - Wire `defaultSettings` -> `audio.updateSettings()` on game start / settings change - Remaining SFX cues: collect coin/gem, powerup, obstacle hit/death, checkpoint, level complete - Tests for `audio.ts` (no-op safety, settings wiring) Issue is re-labeled `triage-approved` for the next pipeline run.
Sign in to join this conversation.
No description provided.