A simple Python text-to-speech module!
Project description
Python TTS
A simple Python module for Text-to-Speech using the gTTS library.
Prerequisites
- Python 3.9+
- gTTS library
- An audio player:
- Windows → Uses default media player
- macOS → Uses
afplay - Linux → Requires
mpg123(sudo apt install mpg123)
Setup
You can clone the repo and install dependencies in one go:
git clone https://github.com/Madhav703/ease-tts.git
cd ease-tts
pip install -r requirements.txt
Or install directly from PyPI:
pip install ease-tts
Usage
from ease_tts import TTS
m = TTS()
m.play("Hello World")
This will generate speech and play Hello World on your system.
Notes for Discord usage:
- Requires FFmpeg installed and in system PATH (
ffmpeg -versionto check). - Make sure the bot has Connect and Speak permissions in the voice channel.
- Temporary files are deleted after playback.
Notes
- Requires an active internet connection (gTTS sends text to Google Translate TTS).
- On Linux, ensure
mpg123is installed for playback (system usage). - For Discord usage, ensure you have FFmpeg installed and available in PATH.
- Temporary files are automatically cleaned up after playback.
Troubleshooting
gtts.tts.gTTSError→ check your internet connection.FileNotFoundError: [Errno 2] No such file or directory: 'mpg123'→ installmpg123on Linux.ffmpeg not found→ install FFmpeg for Discord voice support.- Audio not playing on Windows (system usage) → check if your system has a default MP3 player set.
Contributing
- Fork this repository and make your changes.
- Test the module to ensure everything works.
- Submit a pull request with a clear description.
License
- This project is licensed under the MIT License – see the LICENSE file for details.
Facing any Issues?
- You can open an issue on the GitHub repo.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ease_tts-1.1.0.tar.gz
(3.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ease_tts-1.1.0.tar.gz.
File metadata
- Download URL: ease_tts-1.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e6353609b273fb20b0750c2f2e059586621fd2043f2398d1b6b7f53217f119a
|
|
| MD5 |
7c09d7d76949ca00a8ee68a22c08dde8
|
|
| BLAKE2b-256 |
2a5438e79212a59d984facc3b5feb7ccd67236992e264a3b2638f6f442bfd642
|
File details
Details for the file ease_tts-1.1.0-py3-none-any.whl.
File metadata
- Download URL: ease_tts-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
565bc89e4e114541bcf9e7dfd9de05d79bda74ff7ffe3880994c2be89f8d63f6
|
|
| MD5 |
53544805e519d6a149fec3de83eaeace
|
|
| BLAKE2b-256 |
f9a06ecc6ee73e05881561ce239d2ca9d3cdacec0091bde6a74a2e411c947425
|