A simple, fast, and completely offline Text-to-Speech (TTS) web app — built with Python 3, Flask, and Kokoro ONNX.
No internet connection, no API keys, no GPU required. Just type your text, pick a voice, and generate natural-sounding speech locally on your machine.
- 🎙️ Offline speech synthesis — no cloud services, no internet needed after setup
- 🌍 Multi-language support — 7 languages and accents out of the box
- 🎚️ Adjustable playback speed — from
0.5xto2.0x, in0.05increments - ⬇️ One-click download — save generated audio as a
.wavfile - 💻 Lightweight — runs comfortably with as little as 500MB free RAM
- 🚫 No GPU required — runs entirely on CPU
- 🎨 Modern, clean UI — dark-themed, responsive web interface
| Language | Accent |
|---|---|
| 🇺🇸 English | American |
| 🇬🇧 English | British |
| 🇵🇹 Portuguese | — |
| 🇫🇷 French | — |
| 🇮🇳 Hindi | — |
| 🇮🇹 Italian | — |
| 🇪🇸 Spanish | — |
| Component | Technology |
|---|---|
| Language | Python 3 |
| Web Framework | Flask |
| Audio Processing | soundfile |
| TTS Engine | kokoro_onnx |
- Python 3.x
- RAM: Minimum 500MB free
- GPU: Not required — runs entirely on CPU
- Disk space: Varies — generated audio accumulates in the
Generated_Audiosfolder (see Notes)
This project relies on the Kokoro TTS model files, which are not included in the repository due to their size. You need to download them manually before running the app.
Download the following files:
| File | Size | Link |
|---|---|---|
kokoro-v1.0.int8.onnx |
~88MB | Download |
voices-v1.0.bin |
~27MB | Download |
ℹ️ These are the quantized (int8) model files, chosen for lower RAM usage and CPU-only inference. Full precision (
kokoro-v1.0.onnx, 310MB) and half precision (kokoro-v1.0.fp16.onnx, 169MB) variants are also available on the kokoro-onnx releases page if you prefer higher fidelity.
Place both files inside:
kokoro-web/
└── lib/
├── kokoro-v1.0.int8.onnx
└── voices-v1.0.bin
Or via terminal:
mkdir -p kokoro-web/lib
mv kokoro-v1.0.int8.onnx voices-v1.0.bin kokoro-web/lib/# Clone the repository
git clone https://github.com/MJTech46/PY-Offline-TTS.git
cd PY-Offline-TTS
# Install dependencies
pip install flask soundfile kokoro_onnx
# Move to the directory
cd kokoro-web
# Run the app
python app.pyThen open your browser and navigate to:
http://127.0.0.1:5000/
- Enter your text in the input box
- Select a language from the dropdown
- Select a voice for that language
- Adjust the speed using the slider (
0.5x–2.0x, step0.05) - Click Generate Speech
- Preview the audio using the built-in player
- Click the ⬇️ download icon to save the
.wavfile locally
⚠️ Storage: All generated audio files are saved in theGenerated_Audiosfolder. Over time, this folder can grow large — feel free to delete its contents periodically to free up disk space.
MJ Tech
- 🐙 GitHub: @MJTech46
- 📦 Repository: PY-Offline-TTS
- ✉️ Email: mjtecg46@gmail.com
Found a bug or have an idea for a new feature? Contributions and suggestions are welcome!
- Open an issue on GitHub
- Or reach out directly via email: mjtecg46@gmail.com
This project wouldn't be possible without the following open-source work:
- thewh1teagle/kokoro-onnx — TTS inference using the Kokoro model with the ONNX runtime. The core engine powering the offline speech synthesis in this project.
- Kokoro — the underlying open-weight TTS model.
- Flask — the web framework used to serve the app.
- soundfile — used for reading and writing audio files.
A huge thanks to these authors and maintainers for making their work available to the community. 💙
Made with ❤️ by MJ Tech