ttsfw — Text To Speech FrameWork
ttsfw is a lightweight, fully autonomous Text-to-Speech (TTS) engine written in pure Python.
The project requires no third-party libraries, heavy neural networks, or internet connection. Everything runs locally using LPC (Linear Predictive Coding) algorithms and a built-in, ideal CMU dictionary parser.
✨ Features
- Zero Dependencies: Runs entirely on the Python standard library (
wave,struct,math,io). Nopip installfor audio libraries required. - Ideal CMU Parser: Supports the CMUdict pronunciation dictionary. Automatically uses a fast
cmudict.pklcache (if present next to the module) or parses the plain-text format. - LPC Synthesis (Clear Speech): Formant-based speech synthesis (F1, F2, F3) using resonators, vibrato, and intonation control.
- Smart Text Processing:
- Sentence segmentation (periods, question marks, exclamation points).
- Proper intonation (questions raise pitch toward the end, statements lower it).
- Number-to-words conversion.
- Cross-Platform: The built-in
play()function automatically detects the OS (Windows, macOS, Linux) for audio playback.
🚀 Quick Start
Make sure you have Python 3.6 or higher installed.
from ttsfw import tts, play
# 1. Generate WAV in memory and play it immediately
wav_data = tts("Hello, world! This is a test of the text to speech framework.")
play(wav_data)
# 2. Save the result to a file
tts("The quick brown fox jumps over the lazy dog.", path="output.wav")
# 3. Using createfile
from ttsfw import createfile
createfile("Testing 123.", "test_123.wav")
📂 Important Note on the Dictionary
For the best pronunciation quality (G2P — Grapheme-to-Phoneme), it is recommended to place the cmudict.pkl file in the same folder as init.py (or in the project root).
If the file is missing, the engine will try to find cmudict.dict (the text version), and as a last resort, it will fall back to letter-by-letter reading, which may sound less natural.
📄 License
This project is distributed under the MIT License. You are free to use, modify, and distribute it.
Metadata
Release files for ttsfw 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ttsfw-1.0.0.tar.gz | 944.6 kB | Without provenance | Details for ttsfw-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ttsfw-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for ttsfw-1.0.0-py3-none-any.whl |
Total release size: 1.9 MB
Release files / ttsfw-1.0.0.tar.gz
| Download URL | ttsfw-1.0.0.tar.gz |
|---|---|
| Size | 944.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d416bab8a8c6ab6966672f3c4d1158e78450d810af4b2442769d86b9d67461dd
|
|
BLAKE2b-256 checksum How to use checksums |
3087ef780eace43bc4f8a6bd0a7f1314b0543b40caf093605342c1a6ace5859b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Release files / ttsfw-1.0.0-py3-none-any.whl
| Download URL | ttsfw-1.0.0-py3-none-any.whl |
|---|---|
| Size | 945.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
514c462a57676f3b276bb8b3e36abf6c58fe0feeef5c3a4cd719385afae28a47
|
|
BLAKE2b-256 checksum How to use checksums |
3c5a424aff66d839fcc3a47c8c3b9dc5d0ae1880accc4ed2a7b8694277d83369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.13
|
Security for ttsfw 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.