Skip to main content

Overview

In a typical voice setup, the main agent owns the TTS service and all agents share the same voice. But you can move TTS into each agent’s pipeline so that each agent speaks with a distinct voice. This makes handoffs more natural — the user hears a different voice when they’re transferred to a different agent.

Architecture

The key change is in where TTS lives: Default (shared TTS):
Per-agent TTS:
With per-agent TTS, text-to-speech happens inside each agent’s pipeline. The bus carries audio frames instead of text frames.
Per-agent TTS requires all agents to run in the same process (local bus). Streaming audio frames across a network bus adds too much latency for real-time conversations. For distributed setups, remote agents can achieve distinct voices by joining the same audio session directly through their own transport instead.

Implementation

LLM agent with TTS

Override build_pipeline() on your LLM agent to add TTS after the LLM:
Call super().build_pipeline() to get the default LLM pipeline, then append your TTS service.

Agents with different voices

Create agents with different voice IDs:

Main agent without TTS

Remove TTS from the main agent’s pipeline since each LLM agent handles its own:

Announcing transfers

With per-agent TTS, agents can announce a transfer in their own voice before handing off:
The user hears “Let me connect you with our support team” in the greeter’s voice, then the support agent starts speaking in a different voice.