Race-day audio on every page + TTS cold-start warm-up/watchdog#371
Merged
Conversation
…tart fixes Field reports, same session: 1. Callouts only played on the Live Race Control page — the whole audio stack (player, speech queue, start/end tones, lap detection) lived in that screen and died on navigation. It now lives in an app-shell controller (raceDayAudio.svelte.ts) mounted once from App.svelte, consuming the same app-wide live stream the global header uses: a running race is audible from marshaling, rounds, results — anywhere. The Live page keeps the Callouts toggle + control-click unlocks, driving the shared instance. Bonus: page navigation no longer remounts the detectors, so returning to Live mid-race can never re-buzz the start tone. 2. ~13s of race with no tones or callouts. MEASURED the pipeline first: a scratch heat instrumented at 200ms poll showed passes visible in the live projection 0.22-0.50s (median 0.33s) after the crossing — the data path is sub-half-second. The stall is the browser TTS engine: its first-ever utterance can take seconds or die SILENTLY while the backend spins up, and the serialized queue dammed every later callout behind the corpse. Two fixes: warmUp() speaks a volume-0 utterance on the RD's first gesture (the same one-time unlock that resumes the AudioContext), and a per-utterance dead-engine WATCHDOG (6s) that cancels + advances so one swallowed utterance can never silence the rest of the race. Noted for a later slice: adapter-appended passes carry no recorded_at (the latency measurement had to poll live instead of reading the log). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two field reports: callouts stopped when leaving the Live page (the audio stack lived in that screen), and ~13s of race passed before the first tone/callout.
624 rd-console tests green (audio tests now mount the controller like the app shell does; new watchdog/warm-up unit tests), both svelte-checks clean, eslint+prettier clean.
🤖 Generated with Claude Code