Text To Speech (TTS)

Text-to-Speech (TTS) transforms written words into spoken audio, allowing your applications to “speak” to users naturally. With the Stream Python AI SDK, you can easily add voice capabilities to your video calls and applications, creating experiences where text becomes lifelike speech in real-time.

How does text to speech work?

  1. Read text
  2. Generate speech patterns
  3. Create audio

TTS Basics

Using Text-To-Speech with Stream

The Stream Python AI SDK simplifies text-to-speech integration by providing a clean, plugin-based system that handles all the complexity for you.

Here’s how it works in practice:

  1. Choose Your Voice: Pick from popular TTS providers like ElevenLabs (for ultra-realistic voices), Cartesia, or Kokoro (for offline processing).

  2. Send Your Text: Simply call the send() method with whatever text you want spoken—the plugin handles the rest.

  3. Automatic Audio: The TTS service converts your text to speech and sends back high-quality audio.

  4. Seamless Integration: The SDK automatically routes the audio into your Stream call, so everyone hears it immediately.

  5. Real-time Experience: The speech plays instantly to all call participants, creating a natural conversation flow.

TTS with Stream

Worked example

Let’s walk through a real-world example to see how TTS works in your application.

Imagine you’re building a customer support system where callers get placed in a queue. Here’s how TTS makes this experience feel personal and professional:

The Scenario: A customer calls your support line and gets placed in a queue.

What Happens:

  1. Your system detects the caller and generates a friendly message: “Thank you for calling TechCorp Support. Your estimated wait time is 5 minutes.”

  2. Instead of showing this as text on screen (which the caller can’t see), your TTS plugin converts it to natural speech that sounds like a real person.

  3. The voice speaks directly to the caller through the Stream call, creating an immediate human connection.

  4. As the queue updates, new messages are automatically spoken: “Your wait time is now 3 minutes” or “We’re connecting you to an agent now.”

The Result: Instead of a silent, frustrating wait, customers get a conversational experience that feels like they’re being personally attended to, even when they’re waiting in line.

© Getstream.io, Inc. All Rights Reserved.