Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces support for Telnyx Speech-to-Text (STT) and Text-to-Speech (TTS) services, enabling real-time conversational AI pipelines using Telnyx's voice APIs.
The implementation focuses on low latency and minimal dependencies by leveraging native PCM streaming.
Key Features
TelnyxSTTService: Supports streaming raw audio (WAV/PCM) to Telnyx for real-time transcription.TelnyxTTSService: Supports streaming raw PCM audio from Telnyx (24kHz by default for NaturalHD voices), bypassing the need for external decoding libraries likeffmpegorpydub.src/pipecat/services/telnyx/utils.py: Added utility for generating valid WAV headers required by the Telnyx streaming protocol.examples/foundational/telnyx_openai_agent.pydemonstrating a complete voice-to-voice agent using Telnyx + OpenAI + Daily.co.Implementation Details
mp3topcmin the WebSocket handshake. This eliminates decoding overhead and external dependencies, significantly reducing Time-to-First-Byte (TTFB).LLMUserResponseAggregatorandLLMAssistantResponseAggregatorto handle conversational turns robustly, including handling race conditions where VAD silence detection might outpace cloud transcription.Dependencies
ffmpegis not required).websocketsandaiohttp.How to Test