WIP: uncommitted work at pause (session limit)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas Winther
2026-10-29 23:03:27 +01:00
co-authored by Claude Opus 5.5
parent 8e0ecdaf85
commit ec7ed36426
4 changed files with 140 additions and 4 deletions
+21 -1
View File
@@ -74,6 +74,9 @@ src/
worker/
inference.worker.ts # Transformers.js pipeline, WebNN/WebGPU/WASM selection
protocol.ts # typed postMessage messages (shared with UI)
longform/ # long-form file pipeline (D-WS3a): pure vad.ts / quality.ts / pipeline.ts
# behind transcribeLongForm(audio, deps, options); transformers.ts implements
# the deps (Silero VAD + Whisper decodes) on the same Transformers.js runtime
pwa/
sw.ts # service worker (app-shell precache, /ort runtime cache)
precache.ts # placeholder-injection helpers shared by build + dev serve
@@ -144,6 +147,21 @@ environment). See `WorkBreakdown.md` for the itemized checklist.)
(transcribe | translate).
5. Worker runs the pipeline (chunked, with timestamps), streaming partial results
back via `{type:"partial"}` messages; final result as `{type:"result"}`.
6. **Long-form branch (D-WS3a/D-WS3b, "Advanced → Skip silence", off by default).**
With the option on, every load posted for a file run or the Download button carries
`vad: true`; once the Whisper pipeline is ready the worker loads Silero VAD
(`onnx-community/silero-vad`, 2.2 MB, Cache API like the weights; offline it is
used only if already cached). A file pass with `longForm: true` then runs
`transcribeLongForm` (`worker/longform/`): VAD speech probabilities over the
whole buffer → speech spans (faster-whisper `vad.py` port) → chunks ≤ 30 s cut on
speech boundaries → one Whisper decode per chunk (language detected once on the
first chunk and pinned for multilingual models) → timestamps mapped back to the
file's timeline; progress follows the variable chunks
(`TranscribeProgressTracker.forWindows`). Same `partial` /
`transcribe-progress` / `result` messages as step 5. `choosePipeline` keeps the
chunked path whenever the VAD model isn't loaded, and live passes never take
this branch (live keeps its RMS segmenter, D-016/D-024). A finished transcript
with no words shows "No speech was found in this recording."
### 4.1b Live microphone transcription (anonymous, browser engine — D-016)
1. `LiveControls` starts a session: `getUserMedia` → `AudioContext` at the
@@ -189,7 +207,9 @@ environment). See `WorkBreakdown.md` for the itemized checklist.)
large to precache eagerly.
- Model weights live in the Cache API (`transformers-cache`) via Transformers.js —
independent of the SW, which never touches that cache (D-005). `/api/*` is
network-only.
network-only. The Silero VAD model of the long-form branch lives there too
(D-WS3b); offline, the worker checks that cache before loading it and never
fetches, falling back to the chunked path if it is missing.
- Updates: `pwa/register.ts` surfaces a waiting SW as a toast; accepting posts
`SKIP_WAITING`, activation drops old `whisper-*` caches, and the page reloads.
- Result: with the app installed and at least one model previously loaded, the full