voiceforge·design doc

VoiceForgeworks locally

Text to natural speech, and speech back to text as you talk — all on your own machine, with no paid API.

spec.yaml
type:
Independent product · local AI speech studio
context:
Built independently
area:
AI · Speech · Real-time
stack:
10 technologies
PythonFastAPIPyTorchKokoroWhisperWebSocketsReactTypeScriptRedux ToolkitTailwind CSS

01Problem

Good text-to-speech and dictation usually mean a paid cloud API, per-character pricing, and sending every word to someone else's servers.

02Approach

A studio that runs open models locally. Kokoro-82M turns text into speech in 28 English voices with adjustable speed, rendered in the background and kept in a history with WAV and MP3 downloads. Whisper turns speech into text live: words appear while you speak, in English or Hindi, and become final at each pause.

03Architecture← the interesting bit

  1. Provider interfaces for both directions (BaseTTSProvider, BaseSTTProvider), so another engine never touches business logic
  2. FastAPI with a background generation worker and SQLite; audio as files on disk, metadata in the database
  3. Live dictation: an AudioWorklet streams 16 kHz PCM over a WebSocket; Silero VAD finds pauses; a fast Whisper model gives partials, an accurate one gives finals
  4. Measured, not assumed: CPU beat Apple-Silicon MPS for Kokoro (3–7× faster than real time vs 1.6×), so CPU is the default
  5. Every WAV is validated (silence, clipping, format) before it is saved; MP3 is converted on demand with ffmpeg and cached

04From the notebook

voice, both ways — VoiceForgepaid cloud APIlocal!text → speechtext+ voice, speedBaseTTSProviderswap engines freelyKokoro on CPU3–7× real timeMPS (GPU) by defaultmeasured: 1.6×. CPU winsvalidate WAVsilence? clipping?→ history, MP3 on demandspeech → text, livemicrophoneAudioWorklet16 kHz / wsSilero VADwhere are the pauses?fast Whisperpartials, while talkingaccurate Whisperfinals, after a pausewords on screen~1 s behind youWhisper streams✗ it doesn't →

05Trade-offs & hard parts

risk.01Whisper is not a streaming model: near-real-time text needed voice-activity detection, a fast model for partials and an accurate one for finals.
risk.02Hindi speech came back in Urdu script from the smaller model; auto-detect now chooses between English and Hindi only, and Hindi uses the accurate model.

06Ownership

owner: Everything — product, architecture, model integration and the live-dictation pipeline.

— Hankish

07Outcome

Working end to end on a laptop: speech generated faster than real time, and dictated words on screen about a second after they are spoken.

next: /services/service-studioService Studio