Running OpenVoice V2 in the Browser

I built a local, multilingual voice-cloning workflow for Timeline Studio. Everything runs inside the browser, so no audio data or reference recordings ever leave your device. That keeps your data private and fast.

The system runs OpenVoice V2 with FP16 ONNX, WebGPU, and IndexedDB.

How the workflow works

  • Pick a language and a base voice.
  • Generate the source speech.
  • Upload or record a reference voice.
  • Extract speaker embeddings.
  • Run tone-color conversion.
  • Preview and save the result.

Technical details

The engine splits into two parts: a WASM-based reference encoder and a WebGPU-powered converter. If WebGPU fails, the converter falls back to WASM so everyone can use it.

I chose FP16 for the production model. FP8 exists, but browser support isn’t stable yet. FP16 gives the best mix of speed and audio quality today.

To keep the UI smooth, I moved the entire inference path into a Web Worker. That prevents the browser from freezing during heavy processing. I use transferable ArrayBuffers to shuttle audio data without slowing the system.

Audio quality steps

  • Resample to 22,050 Hz.
  • Apply STFT for conversion.
  • Clean up tails automatically using RMS activity.
  • Soft-limit the signal to avoid clipping at high volumes.

Storage

I store speaker profiles in IndexedDB, letting you reuse a voice across languages without re-running the encoder.

I also added smart caching. The model downloads in parallel from Hugging Face or ModelScope; if the browser cache fills up, the system runs the model from memory instead of throwing an error.

This project is more than an ONNX model—it’s a full system for model delivery, hardware fallback, and local data persistence.

Repository: https://github.com/MartinDelophy/ai-video-editor

Full technical breakdown: https://dev.to/martindelophy/running-openvoice-v2-in-the-browser-with-fp16-onnx-webgpu-and-indexeddb-50kl

Optional learning community: https://t.me/GyaanSetuAi