This Python script allows you to translate text between different languages using the Google Translate API. It also provides the functionality to translate spoken language to text using speech recognition.
Before running the script, ensure you have the following Python packages installed:
- tkinter: GUI toolkit for creating the graphical user interface.
- speechrecognition: Library for performing speech recognition.
- googletrans: Library for Google Translate API.
You can install the required dependencies using pip:
pip install tkinter
pip install speechrecognition
pip install googletrans
- Run the LanguageTranslator.py script in your Python environment.
- Enter the target language and the text you want to translate in the respective input fields.
- Click the "Translate" button to translate the text.
- The translated text will be displayed in the "Output Text" field.
- Optionally, click the "Speak" button to speak the text you want to translate, and the script will recognize your speech and translate it.
- Ensure you have an active internet connection to use the translation services provided by Google Translate.
- The accuracy of speech recognition may vary based on the clarity of the spoken language and the ambient noise.