Run browser file transcription through the long-form pipeline when asked and the VAD model is available

Adds an Advanced "Skip silence in uploaded files" option (off by default
pending measurement), the vad/longForm protocol fields, the old-path
fallback when the VAD model is missing, and a plain message for files
with no speech.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Opus 5.5 committed 2026-10-29 22:02:47 +01:00
1 parent 0c3a83c23c
commit f55ea6ecf8
14 files changed
+363 -8

No files matched your search

+9
View File
@@ -77,6 +77,15 @@ describe("BrowserEngine", () => {
expect("modelId" in message).toBe(false);
});
test("forwards the long-form request only when set (D-WS3a)", () => {
const worker = new FakeWorker();
const engine = new BrowserEngine(worker);
void engine.transcribe(new Float32Array(4), { longForm: true });
void engine.transcribe(new Float32Array(4));
expect(worker.posted[0]!.message.longForm).toBe(true);
expect("longForm" in worker.posted[1]!.message).toBe(false);
});
test("asks the worker to stream only when a consumer listens", () => {
const worker = new FakeWorker();
const engine = new BrowserEngine(worker);