Skip to main content

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). No pip install for audio libraries required.
  • Ideal CMU Parser: Supports the CMUdict pronunciation dictionary. Automatically uses a fast cmudict.pkl cache (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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ttsfw 1.0.1
File Size Uploaded Provenance Actions
ttsfw-1.0.1.tar.gz 945.0 kB Without provenance Details for ttsfw-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ttsfw 1.0.1
File Interpreter ABI Platform Actions
ttsfw-1.0.1-py3-none-any.whl Python 3 none any Details for ttsfw-1.0.1-py3-none-any.whl

Total release size: 1.9 MB

Release files / ttsfw-1.0.1.tar.gz

Download URL ttsfw-1.0.1.tar.gz
Size 945.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7faa15c1433a1ac6e72ef25d1a526a1def6af341fa7c18755046483ea5ae60d8
BLAKE2b-256 checksum
How to use checksums
3cb5a91d9a799f8de7b53d29f9c19afe188f6eb3f4e6b45972a9f67cce0ca6d4
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.1-py3-none-any.whl

Download URL ttsfw-1.0.1-py3-none-any.whl
Size 946.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bfa2afc65b61fde91fee45551a7f88f0cf7f52444a4107658b59f7d7b06577e
BLAKE2b-256 checksum
How to use checksums
7a90089693fb23b7c7c5132e169c9f842749f494bb2e3bc3c5c508c27a2afbac
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.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page