M
40:00
Youth in AI Workshop

How Speech Recognition Works

A plain-English breakdown of how a phone, app, or smart speaker turns your voice into written words.

Sound waves Spectrograms AI models Accents Voice assistants
A
Voice Assistant
listening...
"Play my class recording"
Audio -> text
Play my class recording

The machine does not hear "meaning" first. It hears pressure changes, then searches for the most likely words.

What is speech recognition?

Speech recognition means voice-to-text.

It is the AI process that listens to spoken language and writes down what it thinks was said.

STT

Speech recognition

Figures out the words: "send the invoice to Ama".

ID

Voice recognition

Figures out who is speaking: Enoch, Ama, or someone else.

Today's roadmap

From spoken voice to useful action.

In 40 minutes, we will move from familiar voice tools to the real pipeline behind speech recognition.

0-5 min

Everyday voice AI

Voice typing, voice notes, search, smart speakers, captions, and assistants.

5-14 min

The pipeline

Walk through sound waves, digital audio, spectrograms, and pattern matching.

14-24 min

Voice-to-text test

A live pipeline view, followed by a human recognition challenge.

24-34 min

Modern AI + limits

Explain neural models, messy real-world speech, bias, and accuracy.

34-40 min

Real-world choices

Cloud vs on-device, improving accuracy, safety, and practical use cases.

The path moves from simple intuition to live examples, then into accuracy, fairness, and real-world decisions.
The whole pipeline

It is not magic. It is a chain of guesses.

Each stage makes the next stage easier, until raw sound becomes a transcript.

01
Capture the sound

A microphone records air vibrations.

02
Turn it digital

The device converts the wave into numbers.

03
Find patterns

The system looks at timing, pitch, rhythm, and frequency.

04
Choose words

The model picks the most likely sentence.

Important idea: the recognizer does not "know" with certainty. It ranks possibilities. "I scream" and "ice cream" can sound close, so context matters.
No-API simulation

Tap once and watch voice become text.

This built-in simulation shows the journey without a microphone, account, or internet service. The movement is the explanation.

Human voice

A person speaks. The computer first receives sound, not words.

Stage 1 of 5
E
Please send the class recording to my WhatsApp.
Digital numbers
...

The wave is sampled many times per second.

Sound patterns

The model looks for learned sound shapes.

Best transcript
...

What each movement means

1
Speak

Words leave the mouth as air pressure.

2
Wave

The microphone captures rising and falling vibration.

3
Numbers

The device stores the wave as digital samples.

4
Patterns

AI compares the sound shape with examples it learned.

5
Text

The most likely words appear as the transcript.

The bars are not real recording data. They are a visual model of the process, made so the idea is easy to see.
Voice agent simulation

One person talks. The assistant listens, understands, and replies.

Tap through the conversation to see how speech recognition connects to real-life voice assistants and customer support bots.

Conversation

P
Please book my haircut for Friday at 4 pm.
I heard: haircut, Friday, 4 pm. I can help with that.
AI
P
Yes, and send the reminder to WhatsApp.
Done. Appointment captured and reminder prepared.
AI

Listening to the first voice message

The system receives sound first. It does not start with meaning.

Turn 1 of 4
1. Listen to sound
2. Convert to text
3. Find the request
4. Reply or act
TranscriptPlease book my haircut for Friday at 4 pm.
IntentBook appointment
DetailsService: haircut | Time: Friday 4 pm
OutputConfirm and prepare next action
Interactive demo

Try the pipeline with a real or sample sentence.

Use the microphone if Chrome allows it, or click a sample phrase. The point is to show that speech recognition is a step-by-step conversion, not one mysterious jump.

Voice-to-text mini demo

Sample sentence: "ModSapp can reply to customers at eleven pm."

Transcript will appear here.
If the browser blocks the microphone, use a sample phrase below.

What the machine is doing

1
Capture

Hear air vibrations through the microphone.

2
Convert

Turn the wave into digital numbers.

3
Pattern match

Compare sound patterns with learned examples.

4
Choose words

Pick the sentence that best fits the sound and context.

Clear speech and noisy speech can produce different transcripts, even when the words are the same.
Audience activity

The human recognizer challenge.

This makes the core idea obvious: recognition is guessing from noisy evidence.

Challenge phrase

"I scream for ice cream" or "recognize speech" can sound like other phrases when spoken quickly.

  1. One person says the phrase clearly. Everyone writes what they heard.
  2. The same phrase is repeated faster, quieter, or with music/noise in the room.
  3. Compare the different answers. Circle the words that changed.
  4. Connect it back: ASR models do this at scale, using probabilities instead of human intuition.
  5. Final question: what extra context would help the machine guess correctly?
Step 1

Your voice starts as a moving wave.

When you speak, your vocal cords and mouth create vibrations in the air. A microphone turns those tiny pressure changes into an electrical signal.

  • 1Louder speech creates a taller wave.
  • 2Higher pitch creates faster wiggles.
  • 3Noise adds extra wiggles the machine must ignore.

A waveform is like the fingerprint of loudness over time. It is useful, but it does not clearly show what sounds are inside the voice.

Air wave
Numbers
010110110010110010010110
Tiny frames
Step 2

The audio becomes numbers.

The device samples the sound many times per second. Then the recognizer slices the stream into tiny pieces, often around a few milliseconds each.

Why slice it?

Speech changes quickly. Looking at tiny pieces helps the system compare one small sound at a time, then rebuild the full sentence.

Step 3

A spectrogram turns sound into a picture.

A spectrogram shows which frequencies are strong at each moment. Think of it as a heat map for sound.

  • XLeft to right is time.
  • YBottom to top is low pitch to high pitch.
  • *Brighter areas mean stronger sound energy.
time ->frequency up
Step 4

The system listens for sound patterns, not letters.

Speech is made from small sound units. The same written letter can sound different, and the same sound can be written different ways.

Example: "read" in "I read daily" and "I read yesterday" is written the same, but pronounced differently.
ba

Sounds

The model hears short acoustic patterns like vowels, consonants, pauses, stress, and rhythm.

bar

Words

Those patterns are matched against possible words, then the sentence context helps choose.

What did the person say?

"recognize speech"
"wreck a nice beach"
"recognized peach"

The winner is usually the phrase that best fits both the sound and the language context.

Step 5

The recognizer ranks likely sentences.

Older ASR systems often combined three ideas: what the sound resembles, how words are pronounced, and which word sequence makes sense.

Acoustic model

What sounds did we hear?

Pronunciation model

Which words can sound like that?

Language model

Which sentence is most natural?

Old-school ASR

Before deep learning, the pipeline was more hand-built.

For many years, speech systems used Hidden Markov Models and carefully designed features. They worked, but needed lots of engineering.

Plain-English HMM idea

The machine cannot directly see the word you meant. It sees sound clues, then estimates the hidden path of sounds and words that probably produced them.

1950s-1960s

Small vocabularies

Early systems recognized digits or a few spoken commands.

1980s-2000s

Statistical ASR

HMMs, pronunciation dictionaries, and language models became the classic setup.

2010s-now

Neural ASR

Deep learning learned more of the pipeline directly from large audio datasets.

Modern ASR

Today, the model learns more from data.

Modern systems often use neural networks that learn sound patterns, spelling, timing, and context together.

CTC

Aligns sound to text

Useful when nobody has marked exactly which millisecond matches each letter.

RNN

Streams while you talk

RNN-Transducer style models help phones produce words before the sentence is finished.

LLM

Uses broad context

Transformer systems and large multilingual data improve robustness across topics and languages.

The biggest shift: instead of manually telling the computer every rule, we train models on many hours of speech and transcripts so they learn the patterns.
Why it still fails

Speech is messy in real life.

People mumble, interrupt themselves, use slang, switch languages, speak with different accents, and record in noisy rooms.

01

Sound problems

Background noise, echo, cheap microphones, distance from the phone, overlapping voices.

02

Language problems

Names, local slang, domain words, code-switching, rare products, new brands.

03

Speaker differences

Accent, speed, age, dialect, emotion, disability, or pronunciation differences.

04

Context gaps

The audio may sound like two possible phrases. Without context, the wrong one can win.

Smart speakers

Alexa-style assistants add more steps after the transcript.

Speech recognition only writes the words. The assistant still has to understand intent and act.

1

Wake word

"Alexa" or "Hey Siri" tells the device to pay attention.

2

Speech to text

The spoken request becomes a transcript.

3

Intent

NLP figures out what the person wants.

4

Action

Play music, set a timer, search, or call an API.

5

Talk back

Text-to-speech turns the reply into a voice.

Fairness and access

A system is only as fair as its testing.

If the training data under-represents some accents, dialects, microphones, or environments, the model may work better for some people than others.

  • AUse diverse training and test audio.
  • BMeasure accuracy by accent, region, gender, age, and language mix when appropriate.
  • CLet users correct mistakes so the system can improve.
Research example
35%

Average word error rate reported for Black speakers across five commercial ASR systems in a 2020 PNAS study, versus 19% for white speakers.

This is not a fixed law of speech recognition. It is a warning: audit the system before using it in high-stakes settings.

Accuracy metric

Word Error Rate

WER counts three kinds of transcript mistakes:

Substitution

Wrong word: "cat" becomes "cap".

Deletion

Missing word: "send the invoice" becomes "send invoice".

Insertion

Extra word: "send the invoice" becomes "send the the invoice".

Simple formula
S + D + I

divided by total words

Lower WER usually means a better transcript. But for real products, also check whether the important words are correct: names, prices, medical terms, product codes, dates, and instructions.
Interactive accuracy demo

Let the audience score a bad transcript.

Type what the speaker really said, then type what the machine wrote. The deck calculates Word Error Rate instantly.

What to notice

One small transcript mistake can be harmless. A wrong price, name, date, or medical instruction can change the whole meaning.

0%

No mistakes yet.

Edit the transcript to see substitutions, deletions, and insertions.

How to improve it

Better audio plus better context beats guessing.

Most business improvements are practical, not mystical.

1

Clean input

Good microphone, less echo, less background noise, one speaker at a time.

2

Custom vocabulary

Add names, products, cities, local words, brand names, and industry terms.

3

Domain context

A school app, clinic app, or sales app should bias toward the words used in that domain.

4

Human correction loop

Let people correct the transcript, then use those corrections to improve future results.

Practical choices

Cloud, on-device, or hybrid?

The right setup depends on speed, privacy, cost, internet reliability, and how much customization you need.

CL

Cloud

Strong models, easy scaling, many languages. Needs internet and careful privacy handling.

PH

On-device

Faster and more private. Limited by phone/laptop memory and model size.

HY

Hybrid

Wake word or quick commands local; heavy transcription or summaries in the cloud.

Scenario bank

Use examples people can recognize immediately.

Speech recognition is useful in many places, but context decides whether the result is safe enough to trust.

WhatsApp business order

"I want the black sneakers, size 42, delivery to East Legon."

Most important words: product, size, location, price, and delivery time.

Class recording

"Please summarize yesterday's AI class and list the assignment."

After transcription: summarize, extract tasks, and maybe create reminders.

Clinic note

"Take one tablet twice daily after meals."

High-risk example: one wrong word can change medical meaning.

Noisy shop

"Make it two packs, not three."

Play background noise and ask the audience why quantity words are easy to miss.

Local names

"Send it to Kweku, not Kwesi."

Custom vocabulary matters when names sound similar or are under-represented in training data.

Accent/code-switching

"Chaley, reserve am for me. I go pay MoMo now."

A good system understands how customers actually speak, not only textbook English.

Practical platform lab

Different tools show different parts of voice AI.

Speech recognition is only one layer. These platforms make the full pipeline visible: listen, transcribe, understand, and speak back.

Voice output

ElevenLabs

Turns text into realistic speech, supports voice agents, dubbing, and voice cloning with permission.

Open ElevenLabs
Full voice assistant

OpenAI Audio / Realtime

Shows the complete loop: speech-to-text, reasoning, and spoken response in one experience.

Open OpenAI audio
Live transcription

Deepgram

Shows fast real-time transcription and voice-agent infrastructure for live conversations.

Open Deepgram
Audio analysis

AssemblyAI

Transcribes recorded or live audio and can expose useful structure such as speakers and key terms.

Open AssemblyAI
Custom words

Google Speech-to-Text

Useful for showing custom vocabulary, multilingual transcription, and enterprise speech workflows.

Open Google STT
Enterprise speech

Microsoft Azure Speech

Shows captions, call-center style transcription, pronunciation tools, and cloud speech services.

Open Azure Speech
Hands-on flow

One sentence, four transformations.

The same sentence travels through the voice AI pipeline so every layer becomes visible.

1

Speak

Sentence: "I want the black sneakers, size 42, delivery to East Legon."

2

Transcribe

Chrome, Deepgram, AssemblyAI, Google, Azure, or OpenAI turns the audio into text.

3

Understand

The text becomes structured meaning: product, size, location, delivery request.

4

Speak back

ElevenLabs or OpenAI TTS turns the reply into a natural voice.

The practical lesson: voice AI is not one tool. It is a chain of tools working together.
Platform comparison

Each platform answers a different question.

The best demo depends on which part of voice AI needs to become visible.

Can it hear me?

Chrome speech recognition, Deepgram, AssemblyAI, Google, Azure, OpenAI transcription.

Can it understand me?

OpenAI or another LLM extracts intent, fields, summary, or next action from the transcript.

Can it talk back?

ElevenLabs or OpenAI text-to-speech turns the response into a natural voice.

Can it work in real life?

Accuracy, speed, privacy, cost, local words, accents, and background noise decide production readiness.

Real-life applications

Speech recognition is already around us.

Anytime a machine listens to speech and turns it into text, speech recognition is working in the background.

Voice assistants

"Set an alarm for 6 AM."

Siri, Alexa, Google Assistant, and phone assistants first transcribe the command, then decide what action to take.

Live captions

Speech -> captions on screen

Meetings, YouTube videos, online classes, and events use speech recognition to make spoken content readable.

Customer service

"I want to check my order."

Call centers and voice bots use transcription to route customers, summarize calls, and detect common issues.

Education

Class audio -> notes

Recorded lessons can become transcripts, summaries, quizzes, revision notes, and assignment reminders.

Healthcare

Doctor speaks -> clinical note

Doctors can dictate notes, but accuracy matters because medical words, dosage, and timing are high risk.

Business operations

Voice order -> structured request

Businesses can capture orders, complaints, meeting actions, sales calls, and follow-ups from spoken conversations.

More places it shows up

Speech recognition is a bridge between people and software.

It makes computers easier to use because speaking is often faster and more natural than typing.

Accessibility

People who cannot type easily can control devices, dictate messages, and read captions.

Translation

Speech can become text, then translated into another language, then spoken back.

Search

Voice search lets people find videos, products, locations, and answers without typing.

Security and compliance

Organizations can review calls, flag risky words, and keep searchable records.

Cars and smart devices

Drivers and users can control music, navigation, lights, and devices hands-free.

Live test menu

Four ways to test voice recognition.

These are simple, no-code demos that make speech recognition feel real.

3 min

Clear vs noisy speech

Say the same sentence normally, then while people clap or play low music. Compare the transcript.

Phrase: "Deliver two packs to East Legon before 5 pm."
4 min

Context saves the answer

Two phrases can sound similar. Context helps the system choose the better transcript.

"I scream" vs "ice cream"
"recognize speech" vs "wreck a nice beach"
5 min

Local words challenge

Say Ghanaian names, places, and business terms. Show why custom vocabulary matters.

Kweku, Kwesi, Adwoa, East Legon, Osu, MoMo, Telecel Cash
5 min

WER competition

Two groups create bad transcripts, then compare which one has the higher error rate.

Use the WER calculator slide right after this.
Complete business example

One complete business story.

This connects speech recognition to a real business workflow, so non-technical people see the value immediately.

Teaching point

Speech recognition is only the first layer. A useful AI system also extracts intent, checks business rules, and takes action.

1. Voice input: "I want the black sneakers, size 42, delivery to East Legon."
2. Transcript: The system writes the sentence as text.
3. Extract meaning: Product = black sneakers, size = 42, location = East Legon.
4. Business action: Check stock, calculate delivery, send payment link.
5. Safety check: If size or location is unclear, ask a follow-up question instead of guessing.
Final takeaway

Speech recognition is a translation problem.

It translates messy human sound into text by combining audio patterns, learned language patterns, and probability.

1

Sound becomes numbers

The microphone records vibrations and the computer samples them.

2

Numbers become patterns

Spectrograms and neural networks reveal the structure inside speech.

3

Patterns become words

The model chooses the most likely transcript, then NLP can interpret the meaning.