From 0444bd1297821374294db29a334fd298bf90b8d2 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Fri, 5 Jun 2026 19:54:09 -0400 Subject: [PATCH] zebra-spaces: one transcript line per sentence --- zebra-report/zebra-spaces.html | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/zebra-report/zebra-spaces.html b/zebra-report/zebra-spaces.html index a8f7798..e02f966 100644 --- a/zebra-report/zebra-spaces.html +++ b/zebra-report/zebra-spaces.html @@ -2336,7 +2336,24 @@ async function handleWhisperChunk(uuid, chunk){ if (WHISPER_HALLUCINATIONS.has(norm)) return; if (_lastTranscriptByUuid.get(uuid) === txt) return; _lastTranscriptByUuid.set(uuid, txt); - appendTranscriptLine(uuid, txt); + /* One chunk can contain multiple sentences when the speaker doesn't + * pause inside the 5s window (typical for the host on a close mic). + * Whisper concatenates them — split on sentence-terminating + * punctuation and emit one transcript line per sentence so the + * self-transcript matches the per-sentence cadence the listener + * captures already produce. Fox 2026-06-05: "the self speech to + * text is not creating new lines for when there is new sentence, + * the listeners are doing a better job." */ + const sentences = txt + .split(/(?<=[.!?])\s+/) + .map(s => s.trim()) + .filter(s => s.length > 0); + for (const s of sentences){ + const sNorm = s.toLowerCase().replace(/[.!?,;:\s]+$/,'').trim(); + if (sNorm.length < 2) continue; + if (WHISPER_HALLUCINATIONS.has(sNorm)) continue; + appendTranscriptLine(uuid, s); + } _whisperTick.emitted++; } catch (err){ logLine('err', 'whisper transcribe '+uuid.slice(0,4)+': '+err.message); @@ -7859,8 +7876,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');