Google Cloud Text-To-Speech API
The Google Cloud Text-to-Speech API maps natural language texts to human-like speech. The initial step is to enable the Text-to-Speech API:
Go to Cloud Shell by clicking on the Shell icon. Before diving into the API, check the list of the supported voices and languages. You can check the available languages and voices via Google Cloud Shell using the following command:
curl -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ -H "Content-Type: application/json; charset=utf-8" \ "https://texttospeech.googleapis.com/v1/voices"
The preceding command will list all possible languages and voices, along with their corresponding code. The following screenshot shows just a small part of the list:
Next, we need to create a JSON file named synthesize-text.json
, where we will specify...