Skip to navigation

Build voice agents

Hear the caller with Speech to Text, and answer while your LLM is still writing with Text to Speech.

A voice agent listens, thinks, and speaks in a loop. Murf covers both ends of that loop: Speech to Text (Beta) turns the caller’s audio into text, and Falcon 2.1 turns your LLM’s reply into speech as the tokens arrive. Your LLM sits in the middle.

How the loop works

Caller audio streams over WebSocket in 20-100 ms frames to Murf Speech to Text. The final transcript goes to your LLM, streamed tokens go to Murf Falcon 2.1, and audio chunks return to the caller.

The caller perceives the gap between the end of their speech and the first word of the reply. Each hop adds to that gap:

HopWhat controls itTypical figure
Speech to Text final transcriptFinch model, frame size, region51 ms p50 final-text delay (Cekura)
LLM first tokenYour model and providerVaries by model
Text to Speech first audioRegion, connection reuse, text chunking61–97 ms median by region (Murf study); 138 ms mean to first audible audio (Coval)

Pick your building blocks

You need toUse
Transcribe the caller in real timeSpeech to Text streaming over WebSocket
Speak text that arrives token by token from an LLMText to Speech WebSocket
Speak a complete sentence or promptHTTP streaming
Run inside an agent frameworkPipecat, LiveKit, or Agora

The LiveKit, Pipecat, and Agora integrations provide Murf as the Text to Speech service. Pair them with Murf Speech to Text through its WebSocket, or with your framework’s existing speech recognition.

Five rules for low latency

  1. Keep one WebSocket open per call. Send every turn on it. Reusing the connection saves 30–80 ms of handshake per request.
  2. Stream LLM tokens straight to Falcon. Turn off sentence aggregation in your framework. Falcon splits on punctuation itself, so splitting twice only adds waiting.
  3. Use one context_id per turn, and send clear on that context when the caller interrupts. See Context ID.
  4. Run close to Murf. Use the global endpoint, or the region nearest your agent server. Measure from that server, not a laptop.
  5. Authenticate from your server. Speech to Text and the Text to Speech WebSocket take your API key, so keep them on the backend. See API key safety.

The full checklist is in Latency Optimization.

Write replies for the ear

Your LLM writes every word the caller hears. Markdown, lists, and romanized Hindi all sound wrong when spoken. Prompting Falcon includes a system prompt block you can paste into your agent, with rules for numbers, codes, names, and pauses.

Framework guides