Skip to main content

Overview

WavixFrameSerializer converts audio between Pipecat frames and the Wavix WebSocket media stream format, enabling bidirectional audio streaming between a Pipecat pipeline and Wavix telephony. It is used with FastAPIWebsocketTransport to build voice-enabled applications over Wavix calls.

Source Repository

Source code, examples, and issues for the Wavix integration

PyPI Package

The pipecat-wavix package on PyPI

Wavix

Wavix telephony platform and developer documentation

Create Account

Sign up for a Wavix account and provision a phone number

Installation

This is a community-maintained package distributed separately from pipecat-ai:
pip install pipecat-wavix

Prerequisites

Wavix Account Setup

Before using the Wavix serializer, you need:
  1. Wavix Account: Sign up at Wavix
  2. Phone Number: Provision a Wavix phone number with voice capabilities

Required Environment Variables

  • WAVIX_API_KEY: Your Wavix API key
The example bots in the source repository also use OPENAI_API_KEY, DEEPGRAM_API_KEY, and CARTESIA_API_KEY for the speech and LLM services in the pipeline.

Configuration

The serializer is constructed with a stream_id and an optional InputParams object.
stream_id
str
required
The Wavix media stream identifier, used to address outbound messages.
params
WavixFrameSerializer.InputParams
default:"None"
Serializer configuration. Defaults to WavixFrameSerializer.InputParams() when not provided. See Input Parameters below.

Input Parameters

Configuration passed via the params constructor argument using WavixFrameSerializer.InputParams(...).
ParameterTypeDefaultDescription
wavix_sample_rateint24000The WebSocket wire sample rate expected by Wavix.
sample_rateOptional[int]NoneThe internal Pipecat input sample rate. Typically 16000 for STT and VAD.
audio_trackOptional[str]"inbound"Track filter applied to inbound media. Set to None to disable filtering.
Wavix uses a fixed media format: PCM16, 24 kHz, mono, little-endian, 20 ms frames. See the source repository for the authoritative, up-to-date list of parameters.

Usage

Wire the serializer into a FastAPIWebsocketTransport:
from pipecat_wavix import WavixFrameSerializer
from pipecat.transports.network.fastapi_websocket import (
    FastAPIWebsocketTransport,
    FastAPIWebsocketParams,
)

WAVIX_SAMPLE_RATE = 24000
BOT_SAMPLE_RATE = 16000

serializer = WavixFrameSerializer(
    stream_id=stream_id,
    params=WavixFrameSerializer.InputParams(
        wavix_sample_rate=WAVIX_SAMPLE_RATE,
        sample_rate=BOT_SAMPLE_RATE,
        audio_track="inbound",
    ),
)

transport = FastAPIWebsocketTransport(
    websocket=websocket,
    params=FastAPIWebsocketParams(
        audio_in_enabled=True,
        audio_in_passthrough=True,
        audio_in_sample_rate=BOT_SAMPLE_RATE,
        audio_out_enabled=True,
        audio_out_sample_rate=WAVIX_SAMPLE_RATE,
        add_wav_header=False,
        serializer=serializer,
        audio_out_10ms_chunks=2,
        fixed_audio_packet_size=960,
    ),
)
Outbound audio is automatically converted to Wavix’s required format: PCM16, 24 kHz, mono, little-endian, 20 ms frames. See the source repository for complete server.py and bot.py examples, including webhook handling and call control.

Compatibility

Built against pipecat-ai==0.0.105 (per the package dependencies). Check the source repository for the latest tested version and changelog.