Vonage Audio Serializer for Pipecat
Overview
This guide explains how to connect a Pipecat voice AI pipeline to a Vonage Video session or Voice call using the Vonage Audio Serializer for Pipecat. The serializer handles audio format conversion and WebSocket connectivity between Pipecat and the Vonage platform.
Vonage provides a sample OpenAI-based voice chat agent in the pipecat-examples repository to demonstrate both scenarios covered in this guide.
For use cases that also involve video processing or video avatars, see Video Connector Pipecat Integration.
Before You Start
Before you begin, ensure you have:
Python installed on your server
The Pipecat examples repository cloned locally:
git clone https://github.com/pipecat-ai/pipecat-examples.gitFor Voice sessions only: a phone number that can receive incoming calls
Connect Pipecat to a Vonage Video Session
Create a Vonage Video session using either:
- The Create Session API, or
- The Vonage Dashboard under Video > Tools > Playground
Configure the sample application by updating the environment variables in the
vonage-audio-botfolder with your Vonage credentials and session details. See the README.md for required variables.Start the WebSocket server by following the startup instructions in the README.md.
Open an Audio Connector connection from your Video session to the running WebSocket server, following the Audio Connector guide and the steps in the README.md.
Connect Pipecat to a Vonage Voice Session
Configure the sample application by updating the environment variables in the
vonage-audio-botfolder with your Vonage credentials. See the README.md for required variables.Start the WebSocket server by following the startup instructions in the README.md.
In the Voice Playground in the Vonage Dashboard, create an NCCO that connects an incoming call to your running WebSocket server:
[ { "action": "talk", "text": "Please wait while we connect you to the AI agent" }, { "action": "connect", "from": "YourAssignedNumber", "endpoint": [ { "type": "websocket", "uri": "wss://your.websocket.domain/ws", "content-type": "audio/l16;rate=16000" } ] } ]Call the phone number associated with the Voice Playground application.
See Also
- Vonage Audio Serializer for Pipecat — What the serializer is, how it works, and when to use it
- Audio Connector — Stream audio from a Video session to a WebSocket
- Audio Connector Server SDK — Build custom WebSocket servers to process Vonage Video audio
- Video Connector Pipecat Integration — Use Pipecat with video processing and video avatars
- Vonage Audio Serializer source code
- Vonage Audio Serializer documentation
- Vonage Audio Bot sample application