Our streaming API is designed to return audio to you as quickly as possible. Here are some tips to help you optimize for latency.

1

Use an SDK

Use one of our SDKs to connect to the streaming API. Our SDKs are designed to handle the low-level details of the streaming API, and are optimized for low latency.

2

Use raw format

Use the raw format. It’s the fastest format we offer and returns 16-bit PCM (little-endian) audio at 24 kHz.

3

Use async tasks

Use asynchronous tasks to stream data concurrently. See our Streaming example for a reference implementation.

4

Keep an open connection

If you want to synthesize speech in chunks (e.g. for a chatbot), keep the connection open and send the chunks as they become available.