@todoforai/voiceloop 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/voice-agent.js +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@todoforai/voiceloop",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Fast, interruptible browser voice agent: VAD → STT → LLM → TTS with real barge-in, echo filtering, streaming first-sentence TTS and tap-to-seek. Zero runtime dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
package/src/voice-agent.js
CHANGED
|
@@ -1860,6 +1860,10 @@ export class StreamingTTS {
|
|
|
1860
1860
|
if (idx >= tape.length) { await awaitEntry(idx); if (takePending()) continue; if (idx >= tape.length) break; } // wait for the producer to reach this sentence (stream end → done)
|
|
1861
1861
|
const e = tape[idx];
|
|
1862
1862
|
const buf = await e.blobP;
|
|
1863
|
+
// Barge-in while this clip was mid-synth: the abort cancels the synth fetch, which rejects with
|
|
1864
|
+
// AbortError ("signal is aborted without reason"). That's the cancellation we asked for, not a
|
|
1865
|
+
// failed render — stop quietly, exactly like an abort during playback.
|
|
1866
|
+
if (signal?.aborted) break;
|
|
1863
1867
|
// A clip that failed to RENDER is a voice problem, not an answer problem: the model already
|
|
1864
1868
|
// produced this text and the user is already reading it. Throwing here abandoned every
|
|
1865
1869
|
// REMAINING sentence — the reply went silent partway through and speak() resolved with only
|