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

  • A Vonage account with Video API or Voice API access

  • The Pipecat examples repository cloned locally:

    git clone https://github.com/pipecat-ai/pipecat-examples.git
  • For Voice sessions only: a phone number that can receive incoming calls

Connect Pipecat to a Vonage Video Session

  1. Create a Vonage Video session using either:

  2. Configure the sample application by updating the environment variables in the vonage-audio-bot folder with your Vonage credentials and session details. See the README.md for required variables.

  3. Start the WebSocket server by following the startup instructions in the README.md.

  4. 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

  1. Configure the sample application by updating the environment variables in the vonage-audio-bot folder with your Vonage credentials. See the README.md for required variables.

  2. Start the WebSocket server by following the startup instructions in the README.md.

  3. 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"
          }
        ]
      }
    ]
    
  4. Call the phone number associated with the Voice Playground application.

See Also