From 52866ed77900e1fe4a2467ba22eb295fc47c0c67 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Thu, 4 Jun 2026 18:21:51 -0400 Subject: [PATCH] zebra-spaces: deploy 4s speaker buffer + HTTP lip-sync override --- zebra-report/zebra-spaces.html | 100 ++++++++++++++++++++++++++++----- 1 file changed, 86 insertions(+), 14 deletions(-) diff --git a/zebra-report/zebra-spaces.html b/zebra-report/zebra-spaces.html index 37fc6f5..8d1c46d 100644 --- a/zebra-report/zebra-spaces.html +++ b/zebra-report/zebra-spaces.html @@ -1976,6 +1976,7 @@ function resetListenerBufferReady(){ * last applied value. */ const lipSync = new Map(); /* pubHex → state */ const sfuAudioReceivers = new Map(); /* pubHex → RTCRtpReceiver (SFU audio) — cached so we can restore as the lip-sync source after mesh fail */ +const httpLipSyncOverride = new Map(); /* pubHex → fixed delay (sec). When set, lip-sync uses this directly and skips worklet-derived measurement — for HTTP /stream toggle ON case where the audio source isn't the worklet anymore. */ const LIP_SYNC_HISTORY = 5; const LIP_SYNC_THRESHOLD = 0.05; /* 50ms — below this is within perception noise */ @@ -2009,7 +2010,26 @@ async function refreshLipSyncForUuid(uuid){ for (const [ph, st] of lipSync){ if (st.audioUuid === uuid){ pubHex = ph; e = st; break; } } - if (!e || !e.audioReceiver || e.videoReceivers.size === 0) return; + if (!e || e.videoReceivers.size === 0) return; + /* HTTP /stream override path: when the per-speaker stream toggle is + * ON for this publisher, the audio is coming from an