How to Enable Real-time TTS Chunk Streaming to Cal...
# support
k
## Issue Summary I'm experiencing significant delays in TTS output delivery to callers. My AI agent takes approximately 7 seconds to start responding, with 3-4 seconds being spent on speech generation, despite my custom TTS server being configured for real-time streaming. ## Current Behavior - **Total response delay**: ~7 seconds - **TTS generation time**: 3-4 seconds of the total delay - **Issue**: Vapi appears to wait for complete TTS generation before streaming audio to the caller ## Expected Behavior Real-time streaming of TTS chunks as they're generated, without waiting for complete speech synthesis. ## Technical Details ### My TTS Server Configuration - **Chunk duration**: 0.2 seconds per chunk - **Chunk interval**: Generated every 0.061 seconds - **First chunk delay**: 1 second - **Output format**: Streaming chunks ### Problem Description Despite my TTS server outputting audio chunks in real-time, Vapi seems to collect all chunks before streaming them to the caller, resulting in unnecessary latency. ## Reference Data **Conversation ID**:
04e2c190-981b-4da1-a5bf-c7e8e63300a8
Please review this conversation to see the timing issues in action. ## Questions 1. How can I configure Vapi to stream TTS chunks immediately as they're received from my custom TTS server? 2. Is there a configuration setting or parameter that controls this buffering behavior? 3. Are there any specific requirements for the TTS streaming protocol that I might be missing? ## Environment - Using custom TTS server, configured as described in https://docs.vapi.ai/customization/custom-voices/custom-tts Any guidance on optimizing this streaming configuration would be greatly appreciated!
h
did u find a fix
k
Try switch from HTTP to WebSocket transport with pcm_s16le audio format, as HTTP buffers the full response before playback, causing delays.. https://docs.vapi.ai/calls/websocket-transport
k
My primary use case is traditional phone calls. Based on the documentation you referenced, I understand that WebSocket mode only applies to web/app-based clients and doesn't affect traditional phone call functionality. __What are my available options for real-time TTS audio chunk streaming in a phone call scenario?__
k
Use a custom TTS webhook with chunked PCM audio over HTTP for real-time streaming, WebSocket transport is only for web clients, while listenUrl WebSocket allows monitoring but not audio injection..
c
A gentle reminder to continue this thread.
2 Views