feat(audio): passing sounds decoded once and played through WebAudio, no lag with several cars at once (1.89.27)

This commit is contained in:
larssand committed 2026-11-14 15:40:49 +01:00
1 parent 5241cced77
commit ae829123cc
6 files changed
+112 -5

No files matched your search

+2
View File
@@ -6219,6 +6219,8 @@ let audioCtx = null;
let lastFinishAnnouncementSessionId = null;
const raceAudioEngine = createRaceAudioEngine({
getSettings: () => state.settings.raceAudio,
// Passing sounds through WebAudio (decoded once, low latency); overlay windows stay silent anyway.
getAudioContext: () => (overlayMode ? null : ensureAudioContext()),
speak: (text, options = {}) => new Promise((resolve) => {
let settled = false;
const done = (value) => { if (!settled) { settled = true; resolve(value); } };