]> git.taranathan.com Git - audio-stream.git/commitdiff
gitignore more
authorTaran Nathan <moogoesmeow123@gmail.com>
Wed, 22 Jul 2026 21:01:09 +0000 (14:01 -0700)
committerTaran Nathan <moogoesmeow123@gmail.com>
Wed, 22 Jul 2026 21:07:00 +0000 (14:07 -0700)
.gitignore
script.js

index d35b5406208a44b9fe63b975a78ebdf4b604addd..e8c57325eb6403d1d6587defa5fa7eff83082dfe 100644 (file)
@@ -1 +1,5 @@
+build
+target
+.env
 note.md
+
index 5f9e3e240ca0969d74d2a249ddf520d90220348c..5356538e5b8bdd07438c5a13feb64ce2986c3169 100644 (file)
--- a/script.js
+++ b/script.js
@@ -26,7 +26,7 @@ const TARGET_SAMPLE_RATE = 16000;
 
 function speakerDisplayName(speakerLabel) {
   if (!speakerLabel || speakerLabel === "PENDING") {
-    return "Speaker \u2026"; // "Speaker …" while diarization is still resolving
+    return "Speaker \u2026";
   }
   return `Speaker ${speakerLabel}`;
 }
@@ -53,8 +53,6 @@ function renderTranscription() {
 
     const speakerName = speakerDisplayName(turn.speakerLabel);
 
-    // Start a new visual group whenever the speaker changes, so consecutive
-    // turns from the same speaker stay together instead of re-labeling each one.
     if (speakerName !== lastSpeakerName) {
       currentGroupEl = document.createElement("div");
       currentGroupEl.className = "transcript-turn";
@@ -125,10 +123,6 @@ function cleanupCaptureResources(closeTranscriptionSocket = true) {
   }
 }
 
-// Handles the live "Turn" events. speaker_label starts as "PENDING" and may
-// resolve to a real label (e.g. "A") once diarization has enough context.
-// The same turn_order is sent repeatedly with growing transcript text until
-// end_of_turn is true.
 function handleTurnEvent(payload) {
   if (typeof payload.turn_order !== "number") {
     return;
@@ -148,10 +142,6 @@ function handleTurnEvent(payload) {
   renderTranscription();
 }
 
-// Handles "SpeakerRevision" events, which retroactively correct the speaker
-// label for one or more already-seen turns (identified by turn_order).
-// This is what lets us fix a turn that was rendered as "PENDING" or
-// mis-attributed once the diarization model is more confident.
 function handleSpeakerRevisionEvent(payload) {
   const revisions = Array.isArray(payload.revisions) ? payload.revisions : [];
   if (revisions.length === 0) {