Text-to-Speech REST
An overview of the Deepgram Go SDK and Deepgram text-to-speech.
Installing the SDK
To begin using Deepgram’s Text-to-Speech functionality, you need to install the Deepgram Go SDK in your existing project. You can do this using the following command:
Make a Deepgram Text-to-Speech Request
Audio Output Streaming
Deepgram’s TTS API allows you to start playing the audio as soon as the first byte is received. This section provides examples to help you stream the audio output efficiently.
Single Text Source Payload
The following example demonstrates how to stream the audio as soon as the first byte arrives for a single text source:
Chunk Text Source Payload
This example shows how to chunk the text source by sentence boundaries and stream the audio for each chunk consecutively:
Where to Find Additional Examples
The SDK repository has a good collection of text-to-speech examples. You can find the links to the examples in the README.
Each example will attempt to provide different options on how you might generate a text-to-speech audio.