Do Deepgram and ElevenLabs support Opus directly, and can raw Opus be passed through end-to-end without decoding to PCM and re-encoding (relevant for WebRTC audio pipelines where the transport codec is already Opus/48000)?

webrtc · verified Jul 7, 2026

Fix: Both support Opus, but not as a drop-in "just forward the bytes" passthrough. Verified end-to-end with real API calls: ElevenLabs' WebSocket TTS streaming endpoint with output_format=opus_48000_64 returns Ogg-Opus containerized data (every chunk starts with the 'OggS' magic bytes), not raw/frame-aligned Opus packets usable directly as RTP payloads. A correct Ogg demuxer is required first: Ogg pages bundle multiple Opus packets via a lacing/segment-table mechanism (a naive 'one packet per page' parser is wrong and will produce garbage — payload must be split by walking the segment table, where consecutive 255-byte segment values continue a packet and a value <255 terminates it). Once correctly demuxed, packets are clean, valid, standalone Opus frames matching typical 20ms/960-sample-per-channel framing suitable for direct RTP payload use. On the Deepgram side, no such demuxing is needed: Deepgram's streaming endpoint with encoding=opus&sample_rate=48000 correctly transcribes those exact demuxed Opus packets when sent as discrete WebSocket binary messages at real-time (20ms) cadence, with no PCM decode/resample step required.

opusoggelevenlabsdeepgramwebrtcaudio-codecrtp

References