Package
@cloudflare/voice-twilio@0.1.0 (TwilioAdapter) with agents@0.23.0
Description
Even after the agent WebSocket is connected, callers often hear nothing (or only silence) from the agent.
The voice agent sends binary audio as Blob over the WebSocket. The Twilio adapter's outbound handler only forwards ArrayBuffer:
else if (event.data instanceof ArrayBuffer) {
// convert / send to Twilio
}
Blob frames are ignored, so TTS audio never reaches Twilio.
Expected
Any binary audio from the agent (ArrayBuffer or Blob) is forwarded to Twilio as Media Streams media events.
Actual
Blob audio is dropped → silent call after connect / greeting never plays.
Workaround
Before accepting the agent socket:
agent.binaryType = "arraybuffer";
agent.accept();
Or handle both:
if (event.data instanceof ArrayBuffer) { /* ... */ }
else if (event.data instanceof Blob) {
const buf = await event.data.arrayBuffer();
/* ... */
}
Notes
This is independent of TTS codec choice. Even with ElevenLabs ulaw_8000 / PCM16, frames never leave the adapter if they arrive as Blob.
Package
@cloudflare/voice-twilio@0.1.0(TwilioAdapter) withagents@0.23.0Description
Even after the agent WebSocket is connected, callers often hear nothing (or only silence) from the agent.
The voice agent sends binary audio as
Blobover the WebSocket. The Twilio adapter's outbound handler only forwardsArrayBuffer:Blobframes are ignored, so TTS audio never reaches Twilio.Expected
Any binary audio from the agent (
ArrayBufferorBlob) is forwarded to Twilio as Media Streamsmediaevents.Actual
Blobaudio is dropped → silent call after connect / greeting never plays.Workaround
Before accepting the agent socket:
Or handle both:
Notes
This is independent of TTS codec choice. Even with ElevenLabs
ulaw_8000/ PCM16, frames never leave the adapter if they arrive asBlob.