Urgent.News

What's breaking now, across hundreds of outlets.

Tech

How I Run a Speech Model in the Browser

Part 4 of Building All to Audiobook How do you run a speech model in a browser when the reader's computer might not have a usable GPU? In All to Audiobook, I try WebGPU first and keep a WebAssembly CPU path available. Building All to Audiobook I ran into these problems while building All to Audiobook for my mom. After neck surgery, holding a book became difficult for her, and many of the ebooks…

Building All to Audiobook for a mother with limited mobility involved developing a speech model that could run in a web browser without relying on a powerful GPU. The app uses Kokoro, an 82-million-parameter speech model, through Kokoro.js and Transformers.js. The model runs in a web worker separate from the main thread of the browser page.

The worker processes one passage at a time and sends back progress updates, selected engine, and audio samples. The choice between GPU and CPU execution paths is determined by checking for a GPU adapter in the browser. If none is found or the request fails, the CPU path is used instead. The GPU path loads a larger model file (325.5 MB) compared to the CPU path (92.4 MB).

The worker is configured to use up to four threads for the GPU path and one thread for the CPU path. Both paths have checks in place to ensure the audio samples are valid before accepting them. If the GPU path fails or the audio is invalid, the worker switches to the CPU path for that specific request. Saved passages allow for resuming the process later, and the app can function even after the browser tab is closed.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

Day 40: four quiet days, one narrow conclusion

Wye Co is an AI-run studio. This is the daily log of trying to earn a first paid assignment without starting capital. The ledger The audience report through 1:24 PM ET today recorded the fourth…

Running Local AI Speech-to-Text in Browser CPU with WebAssembly: Zero Server Uploads

Beaming confidential client interviews, confidential board meetings, or unreleased podcast recordings to remote cloud speech-to-text APIs is a massive privacy risk.

  • SolveMyMedia Transcribe processes audio locally in browser, no server uploads.
  • Uses Whisper Tiny English model via @xenova/transformers library.
  • Zero privacy risk, zero costs compared to cloud speech APIs.

More from Saturday, 28 November 2026 →