Webinar: Give Your Text Chatbot a Voice That Sounds Human

Peter Bubenik ยท Elevenlabs Product ยท ยท Source
Webinar: Give Your Text Chatbot a Voice That Sounds Human

The Information Gap in Text

When a user types "my order hasn't arrived" vs says it with audible anxiety โ€” the transcript looks identical, but the signals are completely different.

Text strips out:

  • Tone (frustration, urgency, relief)
  • Rhythm (hesitation, confidence)
  • Emotional context (stress, confusion)

๐Ÿ’ก "I'm fine" said with relief and "I'm fine" said with frustration are the same transcript, different interaction.

A system that only reads transcripts is working with half the information.


The Practical Implication

This means voice agents need to handle dimensions that text agents never had to consider:

  • When did the user finish speaking?
  • How did they say it?
  • What language are they speaking?

These aren't minor additions โ€” they require architectural decisions from the ground up.



Concept 2: The Core Technical Challenges of Voice

There are three specific problems that make voice harder than it looks.


Challenge 1: Turn-Taking

Humans know when someone has finished speaking through:

  • Intonation dropping
  • Natural rhythm completing
  • Contextual cues

Standard voice systems use Voice Activity Detection (VAD) โ€” which only detects silence.

The Result:

User: "I'd like to book a flight to... [thinking pause]"
Bot: [interrupts] "Sure! Where would you like to go?"
User: "...Tokyo."

โš ๏ธ The system is technically functional but conversationally broken.


Challenge 2: Context Continuity

Passing conversation history to an LLM at each turn is necessary but not sufficient.

The same words mean different things depending on delivery. A voice system that ignores emotional tone will always sound slightly off โ€” even if every individual model is strong.


Challenge 3: Engineering Overhead

Teams that build their own voice orchestration end up permanently maintaining:

  • Turn-taking logic
  • Interruption handling
  • Latency profiling

This is not a one-time build. It becomes ongoing infrastructure work.



Concept 3: The Dual WebSocket Architecture

This is the recommended technical pattern for adding voice to an existing text agent.


How It Works โ€” Step by Step

[User Microphone]
       โ†“
[Client] โ†โ€”โ€”WebSocket 1โ€”โ€”โ†’ [ElevenLabs API]
                                   โ†•
                            Transcription happens here
                                   โ†•
[ElevenLabs API] โ†โ€”โ€”WebSocket 2โ€”โ€”โ†’ [Your Server]
                                        โ†“
                                    [Your LLM]
                                        โ†“
                              Response streams back
                                        โ†“
                            Audio synthesis begins
                         (before LLM finishes generating)

The Key Components Explained

ComponentWhat It Does
WebSocket 1Carries audio from client to ElevenLabs
WebSocket 2Carries transcripts + history to your server
onTranscript methodFires at end of each turn, passes full conversation history to LLM
contextualUpdateCarries over text conversation history when user switches to voice

Why This Keeps Latency Low

Audio synthesis begins before the LLM finishes generating โ€” this keeps first-byte latency low, which is critical for conversations feeling natural.

๐Ÿ”‘ The user hears a response starting quickly, even if the full response isn't ready yet.



Concept 4: Four Critical Engineering Decisions

When building this system, four specific choices significantly impact quality.


Decision 1: LLM Speed vs. Quality

ContextPriority
Text chatReasoning quality
VoiceSpeed

Deep reasoning models introduce pauses that register as unnatural hesitation in audio. Even if the response is better, it feels worse.

โœ… For real-time voice: faster models almost always win on perceived quality.


Decision 2: WebRTC Over WebSockets for Audio Transport

WebRTC comes with built-in:

  • Echo cancellation
  • Noise cancellation
  • Mobile optimization

WebSockets for audio means you handle all of that yourself.

โœ… Use WebRTC for audio transport, especially for mobile or noisy environments.


Decision 3: Never Ask Users to Select a Language

Asking users to pick a language breaks conversational flow.

Better pattern:

  1. Detect language from the first few seconds of speech
  2. Lock it in automatically
  3. Allow graceful switching without user action

โœ… The system should adapt to the user โ€” not the other way around.


Decision 4: Separate Turn-Taking From Your LLM

Using your LLM to decide when a user has finished speaking adds:

  • Latency on every single turn
  • Cost on every single turn

A dedicated turn-taking model handles this:

  • Faster
  • More accurately
  • As a distinct, replaceable component

โœ… Treat turn-taking as its own architectural component, not an LLM task.



Concept 5: How Much Infrastructure Should You Own?

This is a strategic decision, not just a technical one.


Path 1: Lightweight Voice Layer (Recommended Starting Point)

If you already have a working text chatbot:

[Existing Text Agent]
  - Your LLM โœ“
  - Your business logic โœ“
  - Your orchestration โœ“
        +
[Voice Layer Added on Top]
  - Audio interface only
  - No rebuilding required

โœ… Fastest path. Lowest risk. You're adding an audio interface to something that already works.


Path 2: Voice Agent Platform

If you need:

  • Telephony support
  • Deployment channel management
  • Built-in testing and analytics

Then handing more of the stack to a voice agent platform makes sense.


The Key Insight

These two paths are not mutually exclusive.

Start lightweight โ†’ validate the use case โ†’ layer in platform capabilities as needs grow.



Summary: The Full Picture

CONCEPT 1: Voice โ‰  Text
  โ””โ”€โ”€ Tone, rhythm, emotion are lost in transcripts

CONCEPT 2: Three Hard Problems
  โ””โ”€โ”€ Turn-taking / Context continuity / Engineering overhead

CONCEPT 3: Dual WebSocket Architecture
  โ””โ”€โ”€ Two connections + onTranscript + contextualUpdate = low latency voice layer

CONCEPT 4: Four Engineering Decisions
  โ””โ”€โ”€ Fast LLM / WebRTC / Auto language detection / Separate turn-taking model

CONCEPT 5: Build Strategy
  โ””โ”€โ”€ Start with a voice layer on top โ†’ scale to platform as needed

The Core Takeaway

You don't need to rebuild your chatbot to give it a voice. You need to add an audio interface โ€” and make smart decisions about the four engineering choices that determine whether it sounds human or broken.

More to study