A lightweight Python demo that prints lines of text to console and speaks them locally using pyttsx3 — a pure-Python offline text-to-speech library.
Perfect as a starting point for voice experiments, audio feedback tools, or real-time voice processing prototypes.
- Robust, thread-safe TTS — pyttsx3 engine initialized inside a dedicated thread (avoids common import-time & multi-threading issues)
- CLI-friendly — full argparse support for customization
- Continuous / one-shot modes — loop forever or run once
- Save to audio file — synthesize text to WAV/MP3 without speaking
- Graceful shutdown — handles Ctrl+C, SIGTERM, etc. cleanly
- Basic unit tests + GitHub Actions CI setup
- Modular design — easy to extend with live microphone input + speech-to-text (coming soon!)
# Recommended: use a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install pyttsx3 pytest flake8
# or if you use poetry/uv/pipenv → add to your project