
Getting Started Guide
How to Use Google Cloud Text-to-Speech
A practical guide to get you up and running with Google Cloud Text-to-Speech. Written by Delv Editorial, Delv Team.
Getting started with Google Cloud Text-to-Speech
In this guide, you'll learn how to set up Google Cloud Text-to-Speech and convert text into lifelike speech within minutes. By the end, you'll be able to create audio outputs using various voices and settings.Step 1: Sign up and set up
- Go to the Google Cloud Text-to-Speech website.
- Click on the "Get started for free" button. This will direct you to the Google Cloud Console.
- If you don’t have a Google account, create one. If you do, sign in.
- Once logged in, you'll be prompted to create a new project. Click on "Select a project" and then "New Project". Name your project and click "Create".
- After creating your project, navigate to the left menu and select "APIs & Services" > "Library".
- Search for "Text-to-Speech API" and click on it. Then, click the "Enable" button to activate the API for your project.
Step 2: Your first text-to-speech conversion
- In the left menu, go to "APIs & Services" > "Credentials".
- Click on the "Create credentials" button and select "API key". Copy this key for later use.
- Now, go to the Text-to-Speech API documentation.
- Scroll down to the "Try this API" section. Paste your API key in the relevant field.
- In the request body, replace the sample text with your desired text. Adjust the parameters like "voice" and "audioConfig" as needed.
- Click the "Execute" button. The response will include an audio file URL. Click on this URL to listen to your generated speech.
Step 3: Get better results
- Experiment with different voices by changing the "voice" parameter. You can choose from various languages and accents.
- Adjust the "speakingRate" and "pitch" parameters to customise how the speech sounds. For example, set "speakingRate" to 1.2 for faster speech.
- Use the "audioEncoding" parameter to choose the format of the audio output (e.g., MP3 or WAV) based on your needs.