Live Voice-to-Voice Translation — Speak into your microphone, and the program will translate your words into another language and play it back.
- Listen to your voice
- Translate spoken words
- Speak out the translation
- Python 3.8+
- Microphone
- Internet connection
- Install required packages:
pip install SpeechRecognition gTTS playsound pyaudio googletrans==4.0.0-rc1- Connect your microphone.
- Run the script:
python VoiceToVoiceTranslator.py- Speak clearly.
- Translation will play back automatically.
- To stop, press
Ctrl+Cor say your stop word (if configured).
Open the script and adjust:
SOURCE_LANG = 'en' # language you speak
TARGET_LANG = 'hi' # language to translate
TTS_LANG = 'hi' # language for audio playback
STOP_WORD = 'zero' # word to stop the program- Make sure the microphone is working.
- If audio isn't clear, speak slowly and adjust noise settings.
- On Windows, run
chcp 65001if you see weird characters.