Using Streamlit, I made this web application.
Streamlit helps us to built web application using just python code. Here is the link for Streamlit - https://streamlit.io/
Here translator.py file is the code used for web aplication.
To know more about the src_lang and tgt_lang codes, check out the reference at https://cloud.google.com/speech-to-text/docs/speech-to-text-supported-languages
In this, you can find the supported language codes.
If you want the code for the transaltion using audio file, available in language_translator_audio.py.
This code works for eveny language. You have to provide the audio file and audio language code (which is availabe here - https://cloud.google.com/text-to-speech/docs/voices).
Using google speech recognition, it will give speech to text and after using gooogletrans, convert the text to english.
Note: No need google cloud subscription. Free to use.
- Text to Speech language translation
For example, if you given the text my name is suresh, first using googletrans it will convert the desired language you want
After using gTTS, It will convert to speech and display audio and translated text.