Convert Speech to Text with Google Cloud!
Valentine’s day is just around the corner and we are sure you are in search of something to make your special one happy. How about learning to convert speech to text and type out your feelings automatically using Cloud Speech API? We have a lab for that: Speech to Text Transcription with the Cloud Speech API.
The setup of this lab is simple and you will be able to complete this setup once you go through the lab instructions.
Create an API key
The first step of this lab is very easy where you just need to create an API key. You need to follow the instructions as given in the API key. Here is what you need to look for
Copy the key and store it as you will require it again further in the lab.
Now use the API key which you have stored in order to export your API Key.
Create your Speech API request
In this lab you will be using a pre-recorded file which is available on Google Storage. When you are using further you can upload a file into Google Storage and convert the speech into text.
Let us now build the Speech API in a request.json file. In order to do that you just need to run the command which is given in the lab instructions. Now you need to edit this json file. In order to that you can use your favorite command line editor. You need to open the file in the editor by running the following the command:
Once you open the the file copy and paste the request given in the lab instructions and save the file.
Call the Speech API
Now we are ready to call the speech API and we will do it with the help of the curl command. Once you run the curl command, the response will be stored in a file named as result.json. Once you run the cat command you will be able to see the output!
Speech to text transcription in different languages
Everything sounds good in French. If you want to French it up, you can do that as well. All you need to do is change the language from“en-US” to “fr” and your script will be translated. The instructions are given in the lab. You can translate the script into more than 100 languages!
We hope you had fun with this lab and you will make the most use of it. You can bookmark this blog as this will definitely come in handy this week. Want to know why? Stay tuned to our social media channels for more information.
Here’s something for you for completing this lab. Enter code 1q-translate-838 to get 3 free credits on your learner journey (valid through February 14th).