All Text-to-Speech code samples
This page contains code samples for Text-to-Speech. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.
Pass text to the Text-to-Speech API
Demonstrates how to pass text to the Text-to-Speech API to synthesize audio.
- Text-to-Speech
- Go
- Java
- Python
- JavaScript
- PHP
- Node JS
Synthesize from a string of text
Demonstrates synthesizing from a string of text.
- Text-to-Speech
- PHP
- Python
- JavaScript
- Java
- Go
- Node JS
Synthesize text with audio profiles
Synthesize text, specifying an audio profile to optimize the synthetic speech for playback on different types of hardware.
- Text-to-Speech
- Java
- JavaScript
- Node JS
- PHP
- Python
Synthesize SSML
Demonstrates how to use SSML with the Text-to-speech API.
- Text-to-Speech
- Go
- JavaScript
- Python
- Java
- Node JS
- PHP
List available voices
Shows how to list the available voices.
- Text-to-Speech
- PHP
- Node JS
- Go
- Python
- JavaScript
- Java