OpenSpeech
Open-source neural text-to-speech that runs on a CPU.
A small FastSpeech 2-inspired TTS model, trained from scratch, built for regular hardware. It predicts duration, pitch, voicing and energy explicitly. American English, single speaker.
Text → Phonemes → Acoustic model → Mel → HiFi-GAN → WAV
No weights or audio are shipped. You train it yourself.
Python 3.10–3.12, 64-bit. CPU PyTorch.
py -3.11 -m venv .venv
.\.venv\Scripts\python.exe -m pip install torch --index-url https://download.pytorch.org/whl/cpu
.\.venv\Scripts\python.exe -m pip install -e ".[readiness]"The readiness extra pulls in eSpeak NG, the aligner and the memory monitor. Use the same eSpeak NG version everywhere (alignment, preprocessing, inference). Got CUDA? Install the matching PyTorch and train with --device cuda.
Grab a small LJSpeech subset, align it, build the cache:
python scripts/fetch_ljspeech_subset.py
python scripts/align_ljspeech.py --dataset datasets/ljspeech-50 --output alignments/ljspeech-50
python scripts/preprocess.py --config configs/openspeech_0.1.1_experiment.yaml --dataset datasets/ljspeech-50 --alignments alignments/ljspeech-50 --metadata alignments/ljspeech-50/accepted.csv --output cache/ljspeech-50Train and evaluate:
python scripts/train_quality.py --cache cache/ljspeech-50 --clips 16 --steps 1000 --interval 500 --milestones 100 300 --output checkpoints/quality-stage-a
python scripts/evaluate_quality.py --checkpoint checkpoints/quality-stage-a/step-01000.pt --cache cache/ljspeech-50 --output samples/quality-stage-a --modes reference predicted_timing predicted_prosody free textResume with --resume (same config, cache and clip count). Training checkpoints and pauses itself if system memory runs low, and logs everything to telemetry.jsonl.
Synthesize (needs a trained checkpoint and the upstream HiFi-GAN V1 22,050 Hz LJSpeech generator):
python scripts/inference.py --text "Hello, I'm OpenSpeech." --output samples/hello.wavA minimal local web page to try a trained checkpoint: type text, play the result and download the WAV. It runs on 127.0.0.1 with OpenSpeech's own model, and new checkpoints show up without a restart. See playground/README.md.
python -m playground.serverThe full LJSpeech pipeline is resumable at every stage and logs every rejected clip. The train, dev and test splits are frozen in configs/splits/.
python -m scripts.prepare_corpus verify
python -m scripts.prepare_corpus align --threads 6
python -m scripts.prepare_corpus features --workers 3
python -m scripts.prepare_corpus manifestThere are 64 standard prompts in configs/eval_prompts.json, including a sealed final set. Synthesis is text-only: no reference timing, pitch or pauses. One scorer runs the same pinned recognizers on every system and exports JSON and CSV.
python -m scripts.synthesize_prompts --checkpoint checkpoints/phase-b/step-06000.pt --system openspeech-b6000 --output benchmark
python -m scripts.score_benchmark benchmark
python -m scripts.make_listening_test benchmark --systems openspeech-b6000 piper-ljspeech-medium kokoro-af_heart --output listening-kitCompetitor setup is in benchmarks/README.md.
These are text-only numbers on 36 dev prompts, all measured on the same PC with the same scorer. After one 2-hour session on the full corpus, OpenSpeech is level with the competitors on automated intelligibility. That's level, not better: the gaps are a few words, and the same prompts were used to pick the checkpoint.
| System | WER | CER | RTF | Peak RAM |
|---|---|---|---|---|
| OpenSpeech, 1,252 updates | 25.6% | 14.0% | n/a | n/a |
| OpenSpeech, 10,000 updates (585 clips) | 9.1% | 3.7% | 0.345 | 671 MiB |
| OpenSpeech, full corpus + 6,000 updates | 2.3% | 1.1% | 0.346 | 641 MiB |
| Piper LJSpeech medium | 4.0% | 1.3% | 0.038 | 385 MiB |
| Kokoro-82M | 2.6% | 1.1% | 0.378 | 1,407 MiB |
Training on the full corpus (9,803 clips, 17.5 h) also fixed the pitch overfitting seen on the one-hour subset. Pauses are still too short, and human listening ratings are pending. Details are in 003 natural speech, with earlier runs in 002 and 001.
The Phase B continuation also tests smaller HiFi-GAN generators. V2 made the same acoustic checkpoint substantially faster in a CPU pilot. The default remains V1 until the new quality and same-host competitor comparisons are complete.
| Parameters | 7.12M acoustic + 13.93M HiFi-GAN V1 |
| Sample rate | 22,050 Hz |
| Output | 80-bin log-mel |
| Vocoder | HiFi-GAN V1 by default; compatible upstream V2 and V3 for experiments |
| Tested on | Ryzen 7 5700G, 16 GB RAM, Windows 11 |
- Single speaker, American English only.
- No explicit punctuation modeling. Short inputs only, no long-text segmentation.
- Out-of-vocabulary phones throw an error.
- Early in full-corpus training. Pauses at punctuation are too short.
- Acoustic model, preprocessing and training
- HiFi-GAN integration
- Forced alignment on a pilot subset
- Small-subset training, resume and first synthesis
- Memory-safe long training, text-only benchmark and competitor baselines
- Full LJSpeech download and frozen splits
- Full-corpus alignment and features (10,377 clips)
- Phase B full-corpus training (first 2-hour session done, continuing)
- Human listening evaluation
Apache 2.0. See MODEL_CARD.md and NOTICE for third-party assets.
