Audio Debugger (Ambient vs Gig)
Key Files
- •
src/utils/AudioManager.js— singleton managing Howler.js playback and MIDI loading - •
src/utils/audioEngine.js— low-level audio scheduling and context management - •
src/utils/audioPlaybackUtils.js— ambient vs gig playback helpers - •
src/utils/audioSelectionUtils.js— song/track selection logic - •
src/hooks/useAudioControl.js— React hook bridging audio into components - •
src/assets/rhythm_songs.json— MIDI track metadata and excerpt offsets - •
src/data/songs.js— song definitions with duration and offset data
Workflow
- •Read
src/utils/AudioManager.jsand trace how ambient playback starts on "Start Tour" (full MIDI tracks via Howler.js). - •Read
src/utils/audioPlaybackUtils.jsand trace gig playback — confirm excerpts start at the configured offset and stop at the expected duration. - •Cross-check
src/assets/rhythm_songs.jsonoffsets againstsrc/data/songs.jsdefinitions. - •Add targeted logging via
src/utils/logger.jsaround start/stop calls, timing offsets, and duration scheduling. - •Ensure AudioContext/Tone.js is initialized on a user gesture (check
useAudioControl.js).
Output
- •Summarize likely causes and the exact files to change.
- •Propose minimal logging to validate behavior without leaking sensitive data.
Related Skills
- •
webaudio-reliability-fixer— for autoplay gating and AudioContext lifecycle issues - •
debug-ux-upgrader— for adding debug overlays and audio state visualization