Path: blob/main/Real-time-voice-translator/Real-time-voice-translator.ipynb
287 views
Real Time Voice Translator
A real-time voice translator that can translate voice input and give translated voice output generated from it. It is created using google’s googleTrans API and speech_recognition library of python. It converts text from one language to another language and saves its mp3 recorded file. The playsound module is then used to play the generated mp3 file
Ref: https://www.geeksforgeeks.org/create-a-real-time-voice-translator-using-python/
Module needed
playsound: This module is used to play sound in Python. pip3 install playsound
Speech Recognition Module: It is a library with the help of which Python can recognize the command given. We have to use pip for Speech Recognition. pip3 install SpeechRecognition
googletrans: Googletrans is a free and unlimited python library that implemented Google Translate API. pip3 install googletrans
gTTs: The gTTS API supports several languages including English, Hindi, Tamil, French, German and many more. pip3 install gTTs pip3 install gTTS-token
Step 1: Importing Necessary Modules
Step 2: All the languages mapped with their code
Step 3: Taking voice commands from the user
Guide To Speech Recognition https://realpython.com/python-speech-recognition/
Start Jack Server $ qjackctl
Step 4: Taking voice input from the user
Step 5: Input destination language from the user, Mapping user input with the language code
Step 6: Translating from src to dest
Step 7: Saving Translated files and deleting them after playing
Implemetation Code: