The Text to Audio Converter application allows users to convert text into audio files using the Google Text-to-Speech (gTTS) service. This application also supports playback controls, including play, pause, and stop, and allows users to save the generated audio in various formats.
- Convert text to audio with customizable speech rate and volume.
- Play, pause, and stop the generated audio.
- Save the audio file in MP3, WAV, or OGG formats.
- Clear the text area for new input.
To run this application, you'll need Python installed on your system along with several libraries. You can install the required libraries using pip
.
tkinter
(for GUI components)gtts
(for text-to-speech conversion)pydub
(for audio file handling)pygame
(for audio playback)ttkthemes
(for themed widgets)uuid
(for generating unique filenames)os
(for file operations)
-
Clone the repository:
git clone https://github.com/glennwanjiru/Texttospeech
-
Navigate to the project directory:
cd your-repository
-
Install the required Python packages:
pip install gtts pydub pygame ttkthemes
-
Optional: Install
ffmpeg
for audio format support withpydub
. Follow the installation instructions from FFmpeg's official website.
-
Run the application:
python text_to_audio_app.py
-
Enter the text you want to convert in the text area.
-
Adjust the speech rate and volume using the sliders.
-
Click "Convert to Audio" to generate the audio file.
-
Use the "Play" button to listen to the audio, "Pause" to pause, and "Stop" to stop playback.
-
Click "Save Audio" to save the audio file to your desired location and format.
-
Use "Clear Text" to empty the text area for new input.
- Audio Playback Issues: Ensure
pygame
is correctly installed and that your system's audio is functioning. - File Saving Errors: Check that the audio file exists before attempting to save and ensure you have write permissions to the chosen directory.
Feel free to fork the repository and submit pull requests. Any improvements, bug fixes, or feature additions are welcome!