AI Protocol Adapter Suite

mod_earshot ยท integration, llm-rag, voice, protocol-adapters, speech-to-text, text-to-speech

Ten protocol adapters (OpenAI Realtime, Deepgram Voice Agent, Twilio Media Streams, ElevenLabs, Gemini Live, Pipecat, Vapi, AssemblyAI, Cartesia, Native) handling wire-format negotiation, codec selection, resampling, and message framing for each vendor.

/*
 * es_proto โ€” protocol adapters for Earshot.  Copyright (c) 2026 Varun Pratap Singh. MIT.
 */
#include "es_proto.h"
#include "es_pb.h"      /* Pipecat protobuf codec (pure C, unit-tested) */
#include "es_cmdguard.h" /* control-channel argument validation (pure C, unit-tested) */
#include <string.h>
#include <strings.h>
#include <stdlib.h>

struct es_proto_ctx {
    es_proto_kind_t kind;
    es_codec_t      codec;      /* wire codec (twilio forces mu-law) */
    int             rate;       /* wire send rate (caller->agent) */
    int             rate_out;   /* wire receive rate (agent->caller); differs for gemini (24k) */
    int             chan_rate;  /* channel (media-bug) L16 rate */
    es_ws_t        *ws;         /* transport, for receive-path auto-responses (pong) */
    switch_au

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key