A simple graphical user interface (GUI) application built with Python and CustomTkinter that allows you to generate Text-to-Speech (TTS) audio using Microsoft Edge's online TTS service (edge-tts) and play it back locally using just_playback.
- Text Input: Enter text directly into the textbox or load content from
.txtor.srt(subtitle) files. - Voice Selection: Fetches and lists available Microsoft Edge TTS voices.
- Voice Search: Filter the voice list using a search bar.
- Rate & Pitch Control: Adjust the speed (rate) and pitch of the generated speech using sliders.
- Audio Generation: Generates MP3 audio from the input text using the selected voice and settings.
- Audio Playback:
- Play, Pause, Resume, and Stop the generated audio.
- Seek forward/backward using buttons or the progress slider.
- Displays current playback time and total duration.
- Save Audio: Save the generated MP3 audio file to your computer.
- Theme Toggle: Supports Light and Dark modes (follows system setting initially, can be overridden with a switch).
- Error Handling: Provides feedback for common issues like missing libraries, network errors, or playback problems.
- Temporary File Management: Automatically creates and cleans up temporary audio files.
- Python: Version 3.8 or higher recommended.
- pip: Python package installer (usually comes with Python).
- Network Connection: Required for
edge-ttsto list voices and generate speech. - Operating System Specific Dependencies:
just_playbackrelies on system audio libraries. See the installation instructions for your specific OS below.
Follow the steps for your specific operating system.
- Install Python & Pip: If not already installed.
sudo apt update sudo apt install python3 python3-pip python3-venv git -y
- Install GStreamer & FFmpeg: These are crucial for audio playback with
just_playback.sudo apt install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav ffmpeg -y
- Clone Repository: Open a terminal and run:
git clone https://github.com/Ashfield-dev/edge-tts-gui.git cd edge-tts-gui - Create & Activate Virtual Environment:
python3 -m venv venv source venv/bin/activate - Install Python Packages:
pip install -r requirements.txt
- Install Python & Pip: If not already installed. (DNF usually installs pip and venv with python3). Consider enabling RPM Fusion repositories first for FFmpeg if not already done.
sudo dnf install python3 python3-pip git -y
- Install GStreamer & FFmpeg:
sudo dnf install gstreamer1-plugins-base gstreamer1-plugins-good gstreamer1-plugins-bad-free gstreamer1-plugins-ugly gstreamer1-plugin-libav ffmpeg -y
- Clone Repository: Open a terminal and run:
git clone https://github.com/Ashfield-dev/edge-tts-gui.git cd edge-tts-gui - Create & Activate Virtual Environment:
python3 -m venv venv source venv/bin/activate - Install Python Packages:
pip install -r requirements.txt
- Install Python: Download and install Python from python.org. Make sure to check the box "Add Python X.X to PATH" during installation. This usually includes
pipandvenv. - Install Git (Optional but recommended): Download and install Git from git-scm.com. This allows you to use the
git clonecommand. Alternatively, download the project ZIP file from the repository page (https://github.com/Ashfield-dev/edge-tts-gui) and extract it. - Clone or Download Repository:
- Using Git (Open Command Prompt or PowerShell):
git clone https://github.com/Ashfield-dev/edge-tts-gui.git cd edge-tts-gui - Or download and extract the ZIP, then navigate to the
edge-tts-guifolder usingcdin Command Prompt/PowerShell.
- Using Git (Open Command Prompt or PowerShell):
- Create & Activate Virtual Environment: Open Command Prompt or PowerShell in the project directory:
python -m venv venv .\venv\Scripts\activate
- Install Python Packages:
(Note:
pip install -r requirements.txt
just_playbackusually works out-of-the-box on Windows, but having FFmpeg installed and in your PATH can sometimes help if you encounter specific audio format issues, though it's often not needed initially.)
- Install Homebrew (if not installed): Open Terminal and run:
Follow the on-screen instructions (you might need Xcode Command Line Tools).
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Install Python & Git:
brew install python git
- Install FFmpeg: Recommended for broader audio compatibility with
just_playback.brew install ffmpeg
- Clone Repository: Open Terminal and run:
git clone https://github.com/Ashfield-dev/edge-tts-gui.git cd edge-tts-gui - Create & Activate Virtual Environment:
python3 -m venv venv source venv/bin/activate - Install Python Packages:
pip install -r requirements.txt
- Make sure you are in the
edge-tts-guidirectory in your Terminal or Command Prompt. - Ensure your virtual environment (
venv) is activated (you should see(venv)at the start of your prompt). - Run the script:
python app.py
- Enter Text: Type or paste text into the main textbox, or click "Load File..." to load from a
.txtor.srtfile. - Select Voice: Choose a voice from the dropdown list. You can use the search bar above it to filter voices.
- Adjust Settings (Optional): Move the Rate and Pitch sliders to modify the speech output. Use the "Reset" buttons to return them to default.
- Generate Speech: Click the "Generate Speech" button. The application will contact the Edge TTS service and create a temporary audio file. The status bar will show progress.
- Playback: Once generated ("✅ Audio generated! Press Play."), use the player controls:
- ▶ Play / ⏸ Pause / ▶ Resume: Toggles playback.
- ⏹ Stop: Stops playback and resets the position to the beginning.
- << / >> Buttons: Seek backward/forward by a few seconds.
- Progress Slider: Drag to seek to a specific position in the audio.
- Save Audio: If audio has been generated and playback is stopped, click "Save Audio as MP3" to save the file permanently.
- Theme: Use the "Dark Mode" switch to toggle between light and dark themes.
- "Error: Required library 'just_playback' not found...": Ensure
just_playbackis installed (pip install just_playbackinside the activated virtual environment). If it's installed but still fails, double-check that the OS dependencies (GStreamer/FFmpeg) were installed correctly for your system during the setup. - "Error loading voices..." / "Error generating audio...": Check your internet connection, as
edge-ttsrequires online access. Sometimes the Edge TTS service might be temporarily unavailable. - Audio Playback Issues (No sound, errors on Linux/macOS): Verify that the GStreamer/FFmpeg libraries were installed correctly as per your OS installation steps. Use system tools to confirm audio output is working generally.
- Audio Playback Issues (Windows): Usually works directly. If issues occur, ensure your system audio drivers are up to date. Installing FFmpeg and adding it to your system PATH might help in rare cases, but isn't typically required for
just_playback. - PermissionError Deleting Temp File: This can occasionally happen if the audio player hasn't released the file lock quickly enough. The script tries multiple times, but if it persists, restarting the app usually resolves it.
gitcommand not found: Ensure Git is installed correctly for your OS and that its location is included in your system's PATH environment variable.pythonorpipcommand not found: Ensure Python is installed correctly and added to your system's PATH (especially important during Windows installation). On Linux/macOS, you might need to usepython3andpip3explicitly ifpythondefaults to Python 2.
This project is licensed under the MIT License - see the LICENSE file for details.

