API stands for Application Programming Interface. It acts as an intermediate between two applications or software. In simple terms, API acts as a messenger that takes your request to destinations and then brings back its response for you. Google API is developed by Google to allow communications with their servers and use their API keys to develop projects.
In this tutorial, we are going to use Google API to build a Langauge Translator which can translate one language to another language. On the internet, we can see lots of projects on Speech Recognitions, Speech to text, text to speech, etc. but here in this project we are going to build something more advance than that.
Let’s assume a scenario, we are traveling in Spain and we don’t know how to speak Spanish or we are in any other country and we don’t know their native language, then we can use this tool to overcome the problem. We can translate between all those languages which are present in google translator.
Now to Check what languages it supports we have to use google trans library. We can use pip to install it.
pip install googletrans
Now to check which languages it supports to run the following code.
Now let’s start building Language Translator. To begin with the coding part, we need to install some dependencies. While installing Pyaudio you might get an error of portaudio. For details of installation of pyaudio click here.
pip install pyaudio pip install SpeechRecognition pip install gtts
Below is the implementation.
Speak 'hello' to initiate the Translation ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Speak a stentence... Phase to be Translated :what are you doing
- Morse Code Translator In Python
- Python - Morse Code Translator GUI using Tkinter
- Python | Get a google map image of specified location using Google Static Maps API
- Python – The new generation Language
- Python Language Introduction
- Python Tweepy – Getting the language of a tweet
- How to Create a Programming Language using Python?
- Difference Between Go and Python Programming Language
- Detect an Unknown Language using Python
- Python Language advantages and applications
- Python - Fastest Growing Programming Language
- Python IMDbPY – Getting the language codes of the series
- Grammar Checker in Python using Language-check
- Why is Python the Best-Suited Programming Language for Machine Learning?
- Python program to find GSoC organisations that use a Particular Programming Language
- How to run Python code on Google Colaboratory
- How to Scrape Web Data from Google using Python?
- Search Google Using Python Selenium
- How to download Google Images using Python
- How to make a Google Translation API using Python?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.