feat(audio): passing tone only during races and remove legacy audio

Adds 'Calls during a race' (default: passing tone only, like timing
systems) that drops name/personal best/leader/position calls in race
sessions; practice keeps them. Removes the legacy audio panel and
fallbacks, including its 'Sound on' switch that silently muted every
race-audio voice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
larssandandClaude Opus 5.5 committed 2026-09-30 21:47:40 +02:00
1 parent 5bfb67ea02
commit aaca5e8c63
13 files changed
+108 -205

No files matched your search

+14
View File
@@ -84,11 +84,25 @@ export function normalizeRaceAudioSettings(value = {}) {
minStartDelay,
maxStartDelay,
perCompetitorPassingTone: source.perCompetitorPassingTone === true,
raceCallouts: source.raceCallouts === "full" ? "full" : "passing",
events,
templates: source.templates && typeof source.templates === "object" ? { ...source.templates } : {},
};
}
// During a race, timing systems give each passing its tone and nothing more: no names, no
// "personal best" / "new leader" calls per lap. raceCallouts "passing" (the default) keeps it
// that way for race sessions; "full" is the speaker mode. Practice always gets the full set,
// and the clock, start, final-lap and results calls are never affected.
export const RACE_PASSING_CALLOUT_EVENTS = Object.freeze(["personal_best", "fastest_lap", "track_record", "new_leader", "position_gain", "position_loss", "provisional_pole"]);
const PRACTICE_TYPES = new Set(["open_practice", "free_practice", "practice"]);
export function isSilencedDuringRace(eventKey, settings, session) {
if (!session || PRACTICE_TYPES.has(String(session.type || ""))) return false;
if (normalizeRaceAudioSettings(settings).raceCallouts === "full") return false;
return RACE_PASSING_CALLOUT_EVENTS.includes(eventKey);
}
const joinUrl = (baseUrl, filePath) => `${String(baseUrl || "").replace(/\/+$/, "")}/${String(filePath || "").replace(/^\/+/, "")}`;
const interpolate = (template, variables = {}) => String(template || "").replace(/\{(\w+)\}/g, (_match, key) => String(variables[key] ?? ""));
function safeEffectPath(value) {