All to Audiobook Runs Kokoro Speech Model in the Browser via WebGPU or CPU

A developer building All to Audiobook, a browser app that converts ebooks into audio for their mother after neck surgery, describes running the Kokoro speech model locally. The app uses an 82-million-parameter model through Kokoro.js, Transformers.js and ONNX Runtime, running in a web worker that processes one prepared passage at a time. It first tries WebGPU and falls back to a quantized WebAssembly CPU path when no usable GPU is available, with the two paths loading different weight file sizes. The worker validates generated audio for finite values and non-silence before returning it. The author also explains the narrow conditions under which the app switches from GPU to CPU during synthesis, to avoid duplicating audio already produced.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in