Skip to content

MJTech46/PY-Offline-TTS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗣️ Kokoro Offline TTS

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.

Python Flask License No GPU


✨ Features

  • 🎙️ 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.5x to 2.0x, in 0.05 increments
  • ⬇️ One-click download — save generated audio as a .wav file
  • 💻 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

🌍 Supported Languages

Language Accent
🇺🇸 English American
🇬🇧 English British
🇵🇹 Portuguese
🇫🇷 French
🇮🇳 Hindi
🇮🇹 Italian
🇪🇸 Spanish

⚙️ Tech Stack

Component Technology
Language Python 3
Web Framework Flask
Audio Processing soundfile
TTS Engine kokoro_onnx

📋 Requirements

  • Python 3.x
  • RAM: Minimum 500MB free
  • GPU: Not required — runs entirely on CPU
  • Disk space: Varies — generated audio accumulates in the Generated_Audios folder (see Notes)

🧩 Model Files Setup

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/

🚀 Installation

# 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.py

Then open your browser and navigate to:

http://127.0.0.1:5000/

📘 How to Use

  1. Enter your text in the input box
  2. Select a language from the dropdown
  3. Select a voice for that language
  4. Adjust the speed using the slider (0.5x2.0x, step 0.05)
  5. Click Generate Speech
  6. Preview the audio using the built-in player
  7. Click the ⬇️ download icon to save the .wav file locally

📝 Notes

⚠️ Storage: All generated audio files are saved in the Generated_Audios folder. Over time, this folder can grow large — feel free to delete its contents periodically to free up disk space.


👤 Author

MJ Tech


🤝 Contributing & Support

Found a bug or have an idea for a new feature? Contributions and suggestions are welcome!


🙏 Credits & Acknowledgements

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

Releases

Packages

Contributors

Languages