Thanks — I’m answering your question about whether you need to start an agent to play a TTS message on an inbound call when the feature flag says “do not accept.”
Short answer: No — you do not need to start an agent or AgentSession to synthesize and play a TTS message. You can generate TTS as a standalone component and play it directly into the call, then hang up.
How you’d typically implement this (high level):
• On inbound call, check your feature flag.
• If flag says “do not accept,” route the call to a simple playback handler instead of creating an agent.
• Create a standalone TTS stream, push the message text into it, consume the synthesized audio frames, publish/play those frames onto the call’s audio path, then disconnect.
Minimal practical options:
• Standalone TTS (recommended for dynamic messages): instantiate a TTS stream, push text, stream audio frames into the call, end call.
• Pre-synthesized file: generate a WAV beforehand (or at runtime), then play the file into the call and hang up.
• Silence/timeout guard (optional): after playback you can wait briefly or use silence detection before disconnecting to ensure the caller heard the message.
Things to confirm so I can give exact code/step-by-step instructions:
1. Do you want TTS generated live or are pre-synthesized files acceptable?
2. How are inbound calls currently handled — via a webhook/dispatch rule, or inside an existing call-processing service?
3. Do you need the message transcribed, logged, or stored, or is playing-and-hanging-up enough?
If you want, I can produce a concise code example for your stack (e.g., Python snippet showing a standalone TTS stream feeding audio frames into the call) once you tell me whether you use live generation or audio files and how your inbound flow is triggered.
Sources:
Text-to-speech (TTS) models overview | LiveKit Documentation |
Playing Audio | LiveKit Documentation, with interactive elements