Skip to main content
Push your agent’s voice to the avatar as your TTS or voice agent generates it. The avatar plays it in sync with its lips.

Audio format

Set the sample rate when you start the session. It must match your audio:
You can also set it per chunk: avatar.pushAudio(pcm, { sampleRate: 16000 }).
  • Audio can arrive faster than real time. It’s queued and spoken at its natural pace, one chunk after another.
  • Don’t send compressed audio. If your TTS only returns MP3, Opus or WAV, decode it to PCM first, and strip WAV headers.
  • Don’t play the audio yourself. The avatar plays it.

Provider settings

Realtime audio deltas are base64 PCM16 at 24 kHz, so pass them straight through:
If your page talks to OpenAI Realtime directly over WebRTC, the voice never reaches your server. Move the Realtime session to your server (WebSocket) to use Realistic Avatars, or use the Open Source avatar in the browser.
Ask for response_format: "pcm": 24 kHz PCM16 mono. Stream the response body into pushAudio:
Use output_format: "pcm_24000" with sampleRate: 24000, or pcm_16000 with sampleRate: 16000.
Use the output format Raw24Khz16BitMonoPcm with sampleRate: 24000.
Use { container: "raw", encoding: "pcm_s16le", sample_rate: 24000 } with sampleRate: 24000.
Ask for raw 16-bit mono PCM at one of the supported sample rates, and pass that rate as sampleRate.

Know when it’s speaking

See Interruptions and speech events.