Skip to content

johnnyfortner/PySpeech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PySpeech

Offline text to speech in python

🗣️ Text-to-Speech Voice App

A simple and efficient GUI-based text-to-speech (TTS) utility using Microsoft's Edge TTS, `pygame` for audio playback, and `ttkbootstrap` for a modern tkinter look.

📦 Installation

Clone repo or download source code

✅ Install Globally (System-Wide)

python -m pip install -r requirements.txt

🧪 Isolated Install via Virtual Environment

python -m venv venv
venv\Scripts\activate
python -m pip install -r requirements.txt

💡 It's recommended to use a virtual environment to avoid dependency conflicts with other Python projects.


🚀 Usage

Run via Python

python app.py

Or double-click app.py if file associations are properly configured on Windows.


🎯 Functionality

  • ✅ Enter text in a modern, styled tkinter GUI
  • ✅ Converts entered text to speech using Microsoft Edge TTS (multilingual)
  • ✅ Saves audio to a temporary .mp3 file
  • ✅ Plays it back instantly with pygame
  • ✅ Works offline once dependencies are installed
  • ✅ Clean threading ensures GUI stays responsive during TTS generation

🛠️ Utilities & Dependencies

  • edge-tts – Leverages Microsoft’s online speech synthesis
  • pygame – Lightweight audio playback for .mp3 output
  • ttkbootstrap – Modern Bootstrap-inspired GUI styling for tkinter
  • tempfile, uuid, os, asyncio, threading, tkinter – Standard Python libraries

🔧 To Do

  • Add ability to export .mp3 files to a user-defined location
  • Voice selection previews
  • Custom speaking rate and pitch sliders
  • Support for macOS and Linux platforms

⚠️ Notes

This app was only tested on Windows 10/11.
Microsoft's built-in TTS options are surprisingly limited and clunky, which is why this tool was hacked together in one morning to solve a real personal need.


🧼 Cleanup

Temporary .mp3 files are created in your OS temp directory and may be cleaned up manually if needed (though they’re generally small and disposable).


📄 License

MIT License – Free for personal and commercial use.


🙌 Credits

Created with Python

If you like this, ⭐️ the repo.

About

Offline text to speech in python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages