diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index a8f7798..e02f966 100644 --- a/web/zebra-spaces.html +++ b/web/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');