HomeSolutionsCustom Voice AI & Streaming
BYO Voice AI Architecture

Build a completely custom AI voice bot on raw PCM WebSocket streams.

Bring your own speech recognition, fine-tuned LLM, and neural TTS. Firetell streams live 16-bit little-endian PCM binary frames to your WebSocket server from outbound REST calls or inbound Call Flow JCA webhooks.
Full-duplex binary PCM 16-bit LE frames
8,000 Hz & 16,000 Hz wideband support
Instant barge-in clear via killAudio
Triggers from Outbound API & Inbound JCA
Step 1 β€’ Carrier

PSTN / SIP / WebRTC Call

Caller connects on local, toll-free, or BYOC SIP numbers.
Step 2 β€’ WSS Binary

Bidirectional PCM Stream

Firetell opens wss:// with call_id metadata and streams 16-bit LE PCM.
Step 3 β€’ Your Stack

STT β†’ LLM β†’ TTS β†’ Playback

Your server streams mono PCM back or sends {"type":"killAudio"} on barge-in.
Architecture options

Two patterns: passive audio fork or full-duplex AI bot.

bidirectional: false

Real-time AI assist & compliance fork

Stream caller and agent channels (stereo left/right) to your inference worker for live agent coaching, fraud scoring, or custom ASR while the conversation stays undisturbed.
bidirectional: true

Full-duplex custom Voice Bot

Your server acts as the conversational brain: decode incoming PCM binary frames, generate replies with your LLM and TTS engine, and write mono PCM back into the live ACTIVE call.
Complete code flow

Launch from POST /calls/make or an inbound JCA webhook.

Check out Firetell's open-source Python and Node.js starter repositories on GitHub to jump-start your WebSocket server.
bash
curl -X POST "https://{workspace_id}.firetell.app/api/v1/calls/make" \
-H "Authorization: ApiKey sk-YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"from": { "number": "+14155550100", "name": "VoiceBot AI" },
"to": { "number": "+12125550123", "name": "John Doe" },
"actions": [
{
"action": "stream",
"params": {
"ws_url": "wss://bot.yourdomain.com/voice-stream",
"track": "both",
"sample_rate": 16000,
"bidirectional": true,
"headers": { "Authorization": "Bearer YOUR_WS_TOKEN" }
}
}
]
}'
WebSocket frame contract

Exact audio wire protocol for zero-guesswork engineering.

DirectionWebSocket FramePayload & Rules
Firetell β†’ Your ServerBinaryPCM 16-bit little-endian at 8000 Hz (default) or 16000 Hz. Stereo (caller left, callee right) when track=both.
Your Server β†’ FiretellBinaryMono PCM 16-bit little-endian at configured sample_rate. Requires bidirectional: true and answered ACTIVE call.
Your Server β†’ FiretellText JSON{"type":"killAudio"} immediately clears queued outbound bot audio for responsive barge-in.
Handshake & IdentityURL + HeadersPublic wss:// or ws:// only; custom handshake headers (max 10) plus call_id & caller_number query params.
Built with Firetell Products

Combine raw streaming with routing or turnkey AI.

Core Action

Audio Streaming API

Full parameter reference, security rules, and GitHub starter repos.
Explore Audio Streaming
Inbound JCA

Visual Call Flow Builder

Play notices or route conditionally before invoking stream via JCA.
Explore Call Flows
Managed Alternative

Managed AI Voice Agent

Prefer a turnkey sub-500ms pipeline without hosting WebSockets?
Compare AI Voice Agent
FAQ

Frequently asked questions

Choose Audio Streaming (action: "stream") when you host proprietary fine-tuned models, custom regional TTS engines, or strict on-premise inference pipelines and want direct access to 16-bit LE PCM audio frames.
Yes. Add a JSON Call Action (json_call_action) webhook node in your visual inbound Call Flow and return { "actions": [{ "action": "stream", "params": { ... } }] }.
When your Voice Activity Detection detects caller speech in incoming binary frames, send the JSON text frame {"type":"killAudio"} over the WebSocket to stop queued playback audio immediately.

Connect your custom AI stack to real phone lines today.

Start building with $3 free API credit and official Node.js & Python WebSocket examples.