This is a Streamlit app that allows you to:
- Translate text into multiple languages π
- Convert translated text into speech (audio) π
- Play the audio inside the app π§
- Download the generated audio as an MP3 π₯
- Input text in any language
- Choose from multiple target languages (English, Hindi, Telugu, Kannada, Malayalam, Tamil, French, Spanish)
- Real-time translation using Google Translator
- Speech synthesis using gTTS (Google Text-to-Speech)
- Instant audio playback
- Option to download the audio for offline use
- Streamlit - Frontend
- Deep Translator - Translation
- gTTS - Text-to-Speech
- Python standard libraries (
tempfile,os)
-
Clone this repository:
git clone https://github.com/your-username/text-to-speech-translation.git cd text-to-speech-translation -
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Linux/Mac venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
Run the app with:
streamlit run app.pyThen open the link in your browser (default: http://localhost:8501).
requirements.txt
streamlit
deep-translator
gTTSInput:
Welcome to my github HARSHAVINJAMURI!
Target Language: Telugu
π Output: Translated Telugu text will be displayed, and you can listen or download the generated Telugu audio.
- Male/Female voice selection is not available in gTTS.
- For English (offline use), you can integrate
pyttsx3to choose male/female voices, but it wonβt support other languages.
This project is licensed under the MIT License.
π‘ Made with β€οΈ using Streamlit