How does a voice agent handle accents and noisy environments?
- Authors
- Name
- Amit Shekhar
- Published on
A voice agent handles accents and noisy environments by cleaning the sound before it listens, using a speech recognition model trained on many voices and many kinds of noise, and checking with the caller whenever it is not sure what it heard.
In this blog, we will learn about how a voice agent handles accents and noisy environments. We will also see why accents and noise confuse a voice agent, how the sound is cleaned before the agent listens, how the agent avoids treating background noise as the caller's turn, how the speech recognition model learns to understand many voices, how the agent uses context and confidence to recover from mistakes, and where this works well and where it still fails.
We will cover the following:
- How a voice agent hears us
- Why accents and noise confuse a voice agent
- Layer 1: Cleaning the sound before listening
- Layer 2: Knowing when the caller is really speaking
- Layer 3: A speech recognition model that has heard many voices
- Layer 4: Using context to fix what was misheard
- Layer 5: Confidence and confirmation
- Where it works well and where it still fails
I am Amit Shekhar, Founder @ Outcome School, I have taught and mentored many developers, and their efforts landed them high-paying tech jobs, helped many tech companies in solving their unique problems, and created many open-source libraries being used by top companies. I am passionate about sharing knowledge through open-source, blogs, and videos.
I teach AI and Machine Learning at Outcome School.
Let's get started.
How a voice agent hears us
Before jumping into accents and noise, we must know how a voice agent works.
A voice agent is a system that talks to us over a phone call or an app using voice. We speak, it understands, it thinks, and it speaks back.
Most voice agents follow a pipeline like below:
Caller speaks
↓
+---------------------------+
| ASR (Speech to Text) |
+---------------------------+
↓
"I want to book a table"
↓
+---------------------------+
| LLM (thinks and replies) |
+---------------------------+
↓
"Sure, for how many people?"
↓
+---------------------------+
| TTS (Text to Speech) |
+---------------------------+
↓
Caller hears the reply
Here, we have three main parts:
- ASR (Automatic Speech Recognition): It converts the caller's voice into text.
- LLM (Large Language Model): It reads that text and decides what to say back.
- TTS (Text to Speech): It converts the reply text back into voice.
In this pipeline, the LLM never hears the caller. It only reads the text that the ASR gives it. So, if the ASR writes the wrong words, the LLM replies to the wrong words.
Hence, handling accents and noise is mostly about one question: how do we make sure the text reaching the LLM is what the caller really said?
Why accents and noise confuse a voice agent
Let's say a caller says "I want to cancel my order."
Now, let's see three different situations.
Situation 1: The caller is in a quiet room and speaks in the accent that the ASR has heard the most. The ASR writes "I want to cancel my order."
Situation 2: The caller has an accent that the ASR has rarely heard. The vowels sound different, and some words are stressed differently. The ASR writes "I want to counsel my order." The LLM is now confused.
Situation 3: The caller is on a busy street. A bus passes by, a horn honks, and someone nearby is talking. The noise covers part of the word "order", and the ASR writes "I want to cancel my daughter." The LLM is confused again.
The ASR has learned to match sound patterns to words by listening to a lot of recorded speech. When the sound pattern is different from what it has learned, because of an accent or because noise is mixed in, it makes guesses. And some of those guesses are wrong.
Noise also creates a second problem. A voice agent must decide when the caller has started speaking and when the caller has finished. A loud TV or a person talking nearby can sound like the caller speaking. Then the agent stops its own reply, or replies to words that the caller never said.
So, the problem has two parts:
- Hearing the right words even when the accent is unfamiliar or the sound is noisy.
- Knowing whose voice it is and when the caller is really speaking.
A voice agent solves this with several layers, and each layer fixes a part of the problem. Let's learn about each layer one by one.
Layer 1: Cleaning the sound before listening
The first layer works on the raw sound, before the ASR sees it.
Noise Suppression is the process of removing background sounds from the audio while keeping the speaker's voice.
Think of it like this. We are trying to hear a friend in a crowded restaurant. Our brain focuses on the friend's voice and pushes the other sounds into the background. Noise suppression tries to do the same thing for the voice agent.
Older methods use simple filters. A steady hum from a fan stays at the same pitch, so a filter can cut that pitch out. But this fails for sounds that keep changing, like traffic, a crying baby, or other people talking.
Modern noise suppression uses a small neural network. It is trained on many examples of clean speech and the same speech mixed with noise. So, it learns what a human voice sounds like and what noise sounds like. Now, when it gets new audio, it keeps the voice and lowers everything else.
Along with noise suppression, two more cleaning steps are common:
- Echo Cancellation: When the caller uses a speakerphone, the agent's own voice comes out of the speaker and goes back into the microphone. Without echo cancellation, the agent treats its own voice as the caller speaking. Echo cancellation removes the agent's own voice from the incoming audio.
- Automatic Gain Control: Some callers speak very softly, and some shout. Automatic gain control brings the volume to a steady level so that the ASR gets audio at a level it can work with.
Note: Cleaning must be done carefully. If the noise suppression is too strong, it also removes parts of the voice. Then the words become harder to recognize, not easier. So, the cleaning is tuned to remove noise without damaging the speech.
Planning your move into AI?
No matter which tech domain you work in today, with your effort, you can transition to these roles:
- AI Engineer
- Forward Deployed Engineer
- AI Agent Engineer
- Harness Engineer
- Voice AI Engineer
- AI Architect
- LLM Engineer
- LLM Inference Engineer
- Gen AI Engineer
- MLOps Engineer
- ML Engineer
- Deep Learning Engineer
Our AI and Machine Learning Program at Outcome School takes you there.
This was all about cleaning the sound. Now, let's see how the agent knows when the caller is really speaking.
Layer 2: Knowing when the caller is really speaking
Here, the agent solves the second problem. It must know when the caller is speaking and when the caller has stopped.
Here comes the VAD (Voice Activity Detection) into the picture.
VAD is the part of the voice agent that looks at the audio and decides, many times every second, whether a human voice is present or not.
A simple VAD only checks how loud the sound is. If the sound is loud, it says "speech". But, in a noisy place, a passing truck is also loud. So, a simple VAD wrongly thinks that the caller is speaking.
A better VAD is a neural network trained to tell the difference between human speech and other sounds. It does not just ask "Is it loud?" It asks "Does this sound like a human voice?" So, a passing truck or a door closing usually does not trigger it.
But, a TV or a person talking nearby is also a human voice. So, voice agents add more checks before they treat a sound as the caller's turn:
- Minimum speech length: A short sound like "uh" or a cough must not make the agent stop talking. The agent waits until the speech lasts long enough before reacting.
- Checking the words: The agent can wait for the ASR to return real words before it stops its own reply. If the ASR returns nothing useful, the agent continues speaking.
- Focusing on the main speaker: Some systems are trained to focus on the voice closest to the microphone and ignore voices in the background. The person holding the phone is usually much louder and clearer than a person across the room.
We have a detailed blog on how a voice agent tells a real interruption from a cough or background noise that explains these checks in depth.
Similarly, the agent must decide when the caller has finished speaking. In a noisy place, the background sound never becomes fully silent. So, the agent cannot wait for complete silence. It uses the VAD and the meaning of the words together to decide that the caller has finished their sentence.
A quick note for you
No matter which tech domain you work in, get familiar with these topics:
- LLM
- RAG
- MCP
- Agent
- Fine-tuning
- Quantization
We put it all together in one video:
AI Engineering Explained: LLM, RAG, MCP, Agent, Fine-Tuning, and Quantization
No need to stop reading - bookmark it and watch later when you get time. Future you will thank you.
Now, let's get back to the topic.
This is how the agent avoids replying to noise. Now, let's move to the ASR itself.
Layer 3: A speech recognition model that has heard many voices
Cleaning removes noise, but it does not change how a person speaks. So, the ASR itself must be able to understand many accents.
The best way to learn this is by taking an example.
Suppose a child grows up hearing only people from one region. That child struggles to understand someone from another region. Another child who grows up hearing people from many places understands new accents much more easily.
An ASR model learns in the same way. If it was trained mostly on one accent, it works well for that accent and poorly for others. If it was trained on many accents, it works well for many people.
So, here are the main ways to make an ASR model strong against accents and noise.
1. Train on a large and diverse set of voices
The training data includes speakers of different ages, regions, and accents, recorded on different phones and microphones. For example, OpenAI's Whisper model was trained on about 680,000 hours of audio in many languages collected from the web, and OpenAI reports that this large and diverse data improved its handling of accents and background noise. More variety in the training data means fewer unfamiliar voices later.
2. Add noise on purpose during training
This technique is called Data Augmentation. We take clean recordings and create new versions of them by:
- Mixing in background sounds like traffic, cafe chatter, or music.
- Making the audio sound like it was recorded in a big room with echo.
- Making the audio sound like a low-quality phone line.
- Speeding up or slowing down the speech a little.
Here, the words stay the same, but the sound becomes harder to recognize. The model learns that "cancel my order" in a quiet room and "cancel my order" next to a busy road are the same words. So, it handles real-world noise better.
3. Fine-tune on the voices the agent will really hear
Let's say a company runs a voice agent for customers in a region where a particular accent is common. The company collects recordings from its own calls (with permission), writes down the correct text for them, and trains the ASR model a little more on this data. This is called Fine-tuning. After it, the model gets better at the exact accents, words, and phone lines that this agent hears every day.
4. Pick the right model for the language and region
Many ASR providers offer separate settings for different regions, for example English (India), English (UK), and English (US). Choosing the one that matches the callers usually gives better results than one general setting for everyone.
To master Fine-tuning and how to Design a Real-Time Voice AI Agent end to end, we can check out our AI and Machine Learning Program at Outcome School.
This is how the ASR learns to handle accents and noise. Now, let's see what happens when the ASR still gets some words wrong.
Layer 4: Using context to fix what was misheard
No ASR is perfect. Some words will still come out wrong. So, the next layer uses context to recover.
1. Telling the ASR which words to expect
Many ASR systems let us give a list of important words in advance. This is called Keyword Boosting. For example, a pharmacy voice agent can boost the names of medicines, and a bank voice agent can boost the names of its products.
When the sound is unclear, the ASR now leans towards these words instead of a common word that sounds similar. So, a product name spoken with a strong accent has a much better chance of being understood. This boosting happens inside the ASR, but it works using context that we give in advance.
2. Letting the LLM use the conversation
The LLM sees the whole conversation, not just one sentence. So, it can often guess the meaning even when a word is wrong.
Let's say the agent asked "Do you want to cancel your order or change the delivery date?" and the ASR returns "I want to counsel my order." "Counsel" makes no sense here, and "cancel" was one of the two options. So, the LLM understands that the caller meant "cancel".
We can make this stronger by writing it into the system prompt of the LLM, like below:
The text you receive comes from speech recognition and can contain mistakes.
Words that sound similar can be swapped. Use the conversation to work out
what the caller most likely meant. If you are not sure, ask the caller
to repeat or confirm.
Here, we are telling the LLM that the text is not perfect, so it must not take every word as it is.
Note: The LLM must not guess when the stakes are high. Fixing "counsel" to "cancel" is fine when there are only two options. Guessing a phone number or an amount of money is not. For that, we need the next layer.
Layer 5: Confidence and confirmation
Along with the text, many ASR systems also return a Confidence Score. It is a number, usually between 0 and 1, that tells how sure the ASR is about the words.
For example:
Text: "My account number is 4 5 8 2 7"
Confidence: 0.62
Here, the confidence is only 0.62. Noise or an unfamiliar accent has made some digits unclear. An account number must be exactly right, so the agent must not just accept it.
The agent can use the confidence score to decide what to do:
| Confidence | What the agent does |
|---|---|
| High | Accepts the words and continues |
| Medium | Repeats back the important part and asks the caller to confirm |
| Low | Politely asks the caller to repeat |
In our example, the confidence is in the middle, so the agent says: "I heard 4 5 8 2 7. Is that correct?" If the caller says no, the agent asks again.
We have a detailed blog on how a voice agent confirms and corrects misheard information that covers this end to end.
When the noise is very bad, the agent can also change how it asks:
- Ask the caller to spell a name letter by letter, or say digits one by one.
- Ask the caller to type the number on the phone keypad instead of speaking it. The keypad tones are much easier to detect than spoken digits in a noisy place.
- Ask the caller to move to a quieter place.
- After a few failed attempts, hand the call over to a human.
This is how the agent makes sure that a misheard detail does not turn into a wrong action.
Stay updated: Subscribe to our newsletter to get our latest AI and Machine Learning blogs straight to your inbox.
Where it works well and where it still fails
It works well when:
- The noise is steady, like a fan, an engine, or the hum of a crowd.
- The caller's accent is well represented in the ASR training data.
- The important words are known in advance and boosted.
- The agent confirms important details like numbers and names.
It still struggles when:
- Another person is talking loudly right next to the caller, because their voice sounds just like the caller's voice.
- The accent is rare in the training data, and the company has no recordings to fine-tune on.
- The phone line is very poor, and parts of the speech are lost.
- The caller mixes two languages in one sentence, and the ASR is set up for only one.
- The caller says names, addresses, or rare words, because the ASR has seen very less data for them.
Now we must have understood how a voice agent handles accents and noisy environments, how each layer works, and where it works well and where it still fails.
Frequently Asked Questions
Can noise suppression make speech recognition worse?
Yes. If the noise suppression is too strong, it also removes parts of the caller's voice, and the words become harder to recognize, not easier. So, the cleaning is tuned to remove the noise without damaging the speech.
Why does a voice agent need echo cancellation?
When the caller uses a speakerphone, the agent's own voice comes out of the speaker and goes back into the microphone. Without echo cancellation, the agent treats its own voice as the caller speaking. Echo cancellation removes the agent's own voice from the incoming audio.
How does data augmentation help speech recognition handle noise?
Data augmentation takes clean recordings and creates harder versions of them by mixing in traffic or cafe chatter, adding room echo, making the audio sound like a low-quality phone line, or changing the speed a little. The words stay the same, so the model learns that a sentence spoken in a quiet room and the same sentence spoken next to a busy road are the same words. So, it handles real-world noise better.
Why should a voice agent ask for keypad input in a noisy place?
The keypad tones are much easier to detect than spoken digits in a noisy place. So, when the noise is very bad, the agent can ask the caller to type a number on the phone keypad instead of speaking it. This keeps an important detail like an account number from being misheard.
That's it for now.
Thanks
Amit Shekhar
Founder @ Outcome School
You can connect with me on:
Follow Outcome School on:
