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/quality-stage-b/step-10000.pt --system openspeech-a10000 --output benchmark
python -m scripts.score_benchmark benchmark
python -m scripts.make_listening_test benchmark --systems openspeech-a10000 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. OpenSpeech is still behind both competitors.
| System | WER | CER | RTF | Peak RAM |
|---|---|---|---|---|
| OpenSpeech, 1,252 updates | 25.6% | 14.0% | n/a | n/a |
| OpenSpeech, 10,000 updates | 9.1% | 3.7% | 0.345 | 671 MiB |
| Piper LJSpeech medium | 4.0% | 1.3% | 0.038 | 385 MiB |
| Kokoro-82M | 2.6% | 1.1% | 0.378 | 1,407 MiB |
OpenSpeech has trained on about an hour of audio so far, and the pitch prediction overfits it. Human listening ratings are still pending. Details are in 003 natural speech, with earlier runs in 002 and 001.
| Parameters | 7.12M acoustic + 13.93M HiFi-GAN V1 |
| Sample rate | 22,050 Hz |
| Output | 80-bin log-mel |
| Vocoder | Optional pretrained HiFi-GAN V1 |
| 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.
- Trained on about one hour so far. Intonation is flat, and full-corpus training is still to do.
- 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 training (in progress)
- Human listening evaluation
Apache 2.0. See MODEL_CARD.md and NOTICE for third-party assets.
