nyosegawa/speech.cpp
Speech synthesis, speech recognition and voice activity detection for voice conversation, in C++ on ggml: Qwen3-TTS, Irodori-TTS, Qwen3-ASR, ReazonSpeech, parakeet and Silero VAD on Metal, Vulkan and the CPU, with an OpenAI-compatible server and live transcription.
What speech.cpp is
speech.cpp is a C++ toolkit for working with spoken audio — turning text into speech, turning speech into text, and analyzing recordings — all run locally on your own computer. It's built on a machine-learning library called ggml, which lets it run on ordinary CPUs as well as Apple's Metal and the cross-platform Vulkan graphics APIs, with no Python and no NVIDIA CUDA required.
Everything comes as one executable (speech) and one shared library (libspeech), behind a single C API. Models are downloaded by name from Hugging Face as single GGUF files the first time you use them.
What it can do
- Speech synthesis (text → audio): speak text into a WAV file or straight to output.
- Speech recognition (audio → text): transcribe recordings, or the microphone live as someone speaks.
- Voice activity detection: find where in a recording someone is speaking.
- Speaker diarization: determine who speaks when, for up to eight speakers.
- Audio enhancement: remove noise, reverberation, and band limits from recordings.
- Voice cloning setup: create a voice profile from reference recordings for certain models.
- Local OpenAI-compatible server:
speech serveanswers OpenAI's audio API endpoints, so existing OpenAI client code works by just changing the base URL. - Worker mode:
speech workerserves a model over JSON Lines on stdin/stdout, for programs that want to keep models loaded between requests.
Speed
A headline claim: time to first audio of a quarter second or less. On an Apple M5, the Qwen3-TTS 0.6B model sends its first audio 0.029 seconds after receiving text; the Irodori-TTS Japanese model does it in 0.16 seconds. The rest of the audio streams out while the first part plays.
Models
The project maintains a catalog of converted models, each with a name you pass to the command. Highlights:
| Task | Example models | Notes |
|---|---|---|
| Synthesis | qwen3-tts-0.6b, qwen3-tts-1.7b |
10 languages, nine named speakers; the 1.7B model follows speaking-style instructions |
| Synthesis | irodori-tts-mf, irodori-tts, irodori-tts-large |
Japanese; clones a voice from a reference recording or from a text description |
| Synthesis | drama-3 |
83 languages; generates scenes with up to 16 speakers, including cues like laughter; 20.8 GB file |
| Recognition | qwen3-asr-0.6b, qwen3-asr-1.7b |
30 languages; auto-detects language, accepts prompts with names/terms, handles up to 20 minutes at once |
| Recognition | reazonspeech-v2 |
Japanese with punctuation, for long recordings |
| Recognition | parakeet-tdt_ctc-0.6b-ja |
Fast Japanese, short utterances, with timestamps |
| Recognition | parakeet-tdt-0.6b-v3 |
25 European languages, auto-detects language, punctuation and capitals |
| Recognition | haas-ja-v1.0 |
Fast Japanese with punctuation and timestamps |
| Recognition | nemotron-3.5-transcribe |
40 languages; word-for-word including fillers, up to an hour, with speaker labels; 19 GB file |
| Detection | silero-vad |
Tiny (1.2 MB); finds speech regions to feed a recognizer |
| Diarization | nemotron-3-diarization |
Who speaks when, up to 8 speakers, live or from a recording; 106 MB |
| Enhancement | re-use, re-use-laughter |
Removes noise/reverb/band limits at 8–48 kHz; the laughter variant preserves laughter; 38.5 MB |
Quick start
# 1. Speak a sentence (downloads the model, 1.21 GB, on first run)
speech tts qwen3-tts-0.6b --voice ryan -o hello.wav "Hello. It will be sunny in Tokyo tomorrow."
# 2. Transcribe it back (0.84 GB first time)
speech asr qwen3-asr-0.6b hello.wav
# → Hello, it will be sunny in Tokyo tomorrow.
# 3. Open a web page to try models interactively
speech serve --open
Command-line subcommands
tts, asr, vad, diarize, enhance, voice, info, devices, models/pull/rm (model management), quantize, update, serve, and worker.
Installation
- macOS (Apple silicon) / Linux (x86-64): one curl command that downloads, verifies SHA-256, installs under your home folder, and adds to PATH.
- Windows x64: one PowerShell command, same behavior.
- Linux picks the Vulkan build if the Vulkan loader is present, otherwise a CPU build; needs glibc 2.34+.
- Other systems (e.g., Intel Mac): build from source.
Accuracy
Every stage of every model is checked against the model's official implementation, using dumped tensors from the same inputs. The recognizers reproduce the official text on every check input in both F32 and F16 precision. The README includes detailed benchmark tables (character error rates, time-to-first-audio, real-time factor) measured on an Apple M5 and an RTX 2080.
Licensing
The code is MIT. Model weights have their own licenses: Apache 2.0 (Qwen models, ReazonSpeech, Haas-ja), MIT (Irodori-TTS, Silero VAD), CC-BY-4.0 (Parakeet), Fish Audio Community License 1.0 (Drama 3 — free for research and non-commercial use, commercial use allowed under $500K yearly revenue, separate license needed for a speech/voice-cloning service), and OpenMDW License Agreement 1.1 (Nemotron models). Irodori-TTS v4-Large carries additional ethical restrictions: no voice cloning without consent, no deepfakes or misinformation.
Documentation
The README links to detailed docs for installation, every CLI option, each model family, the server API, the worker protocol, and the C API.
Related
- Project
- Project
- Project
- Project