A Python project that converts text into speech using Google Text-to-Speech (gTTS).
Follow these steps to set up and run the project:
- Python 3.7 or higher
- pip (Python package installer)
-
Clone the Repository
git clone [email protected]:TaraJura/text_to_speech.git cd text_to_speech
-
Create a Virtual Environment
Create an isolated environment to manage dependencies:
python3 -m venv venv source venv/bin/activate
-
Install Dependencies
Install all required Python libraries:
pip install -r requirements.txt
-
Run the Project
Execute the program to convert text to speech:
python main.py
-
Test the Output
- Enter text when prompted
- The MP3 file will be saved in the
output/
directory - Use a media player (like VLC) to play the file:
vlc output/output.mp3
- Converts text to speech using Google Text-to-Speech
- Outputs speech as a high-quality MP3 file
- An active internet connection is required, as the project uses Google Text-to-Speech, which operates online
- Avoid using sensitive or private information in the input text
text_to_speech/
│
├── main.py # Main script for the text-to-speech conversion
├── requirements.txt # List of dependencies
├── output/ # Folder where MP3 files are saved
├── venv/ # Virtual environment (ignored by Git)
└── .gitignore # Git ignore file
The project uses the following Python libraries:
- gTTS: Google Text-to-Speech library for online TTS conversion
To install the dependencies manually:
pip install gTTS
We welcome contributions to improve this project! Please follow standard Git workflow:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is open source and available under the MIT License.