Skip to content

feat(voice-to-text): Web Worker (no freeze) + persistent model cache - #82

Merged
slaveofcode merged 2 commits into
developfrom
feat/voice-worker
Aug 1, 2026
Merged

feat(voice-to-text): Web Worker (no freeze) + persistent model cache#82
slaveofcode merged 2 commits into
developfrom
feat/voice-worker

Conversation

@slaveofcode

Copy link
Copy Markdown
Owner

Follow-up to the report that the 'Better' model 'kept transcribing' ~1 min and looked hung. It wasn't broken — inference ran on the main thread so the page froze; a shorter clip completes fine (and Bahasa output is accurate).

  • Move inference to a Web Worker (stt.worker + stt.client) — UI stays responsive, progress flows, audio player works. One long-lived worker keeps the model cache warm.
  • Live elapsed timer while transcribing, and a note that the 'Better' model is much slower on phones.

545 tests · lint clean · build green (stt.worker chunk emitted; transformers stays globIgnored). Worker/model path is build + manual smoke.

🤖 Generated with Claude Code

Transcription ran on the main thread, so the whole page froze during inference —
which on the larger 'Better' model + a 30s clip on a phone can take minutes and
looks hung (it wasn't; a shorter clip completes fine).

- Move inference into a dedicated Web Worker (stt.worker + stt.client). The main
  thread stays responsive: the audio player works, and progress updates flow.
  A single long-lived worker keeps the in-worker model cache warm across runs.
- Show a live elapsed timer while transcribing (now that the thread is free), and
  warn that the 'Better' model is much slower on phones.

545 tests · lint clean · build green (stt.worker chunk emitted; transformers stays
in workbox globIgnores).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
goodwebtools 9b121e7 Aug 01 2026, 11:25 AM

…nload

On mobile the browser can evict the cached Whisper model between sessions under
storage pressure, forcing a re-download on refresh. Request persistent storage
(navigator.storage.persist) so the origin's cache isn't evicted.
@slaveofcode slaveofcode changed the title feat(voice-to-text): transcribe in a Web Worker (no UI freeze) feat(voice-to-text): Web Worker (no freeze) + persistent model cache Aug 1, 2026
@slaveofcode
slaveofcode merged commit 6d30ac4 into develop Aug 1, 2026
1 of 2 checks passed
@slaveofcode
slaveofcode deleted the feat/voice-worker branch August 1, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant