Book a free call

How to Implement Speech Recognition in Your Product

Speech recognition turns spoken words into text your product can act on. This guide covers the pipeline, the build-or-buy choice, and the steps to ship it.

Hertiv engineering teamReviewed by a senior engineer
7 min read
How to Implement Speech Recognition in Your Product
On this page

Short answer

Speech recognition is software that converts spoken audio into written text, which your product can then search, store or act on. To implement it, you capture audio, send it to a recognition engine, receive a transcript with confidence scores, and handle the result in your own code. Start with a managed API, test on real recordings, and add human review where errors are costly.

What is speech recognition?

Speech recognition is software that converts spoken audio into written text, which a product can then search, store or act on. It listens to a recording or a live microphone feed and returns a transcript, often with a confidence score for each word.

It is the starting point for voice features such as dictation, voice commands, call transcription and meeting notes. The transcript is the raw material; what your product does with it is a separate decision.

The pipeline has four stages:

  • Capture. Audio is recorded and cleaned, removing background noise and normalising volume.
  • Feature extraction. The audio is turned into a compact numerical form the model can read.
  • Recognition. An acoustic model and a language model work together to guess the most likely words.
  • Output. The transcript is returned, usually with timestamps and confidence scores.

Modern systems handle accents, background noise and overlapping speech far better than early ones, but they still make mistakes. Your design should assume errors will happen and plan for review where they matter.

How does speech recognition work?

Speech recognition works by matching patterns in audio against models trained on large amounts of recorded speech. The acoustic model maps sounds to phonemes, and the language model picks the word sequence that makes the most sense in context.

Two properties of the pipeline matter for implementation:

Stage What it does What affects quality
Audio capture Records and cleans the signal Microphone quality, noise, distance
Acoustic model Turns sound into likely phonemes Accent coverage, training data
Language model Chooses the most likely words Domain vocabulary, context
Post-processing Formats, punctuates, adds timestamps Custom terms, speaker labels

Real-time recognition returns words as they are spoken, which suits live captions and voice commands. Batch recognition processes a finished recording, which suits call archives and meeting notes and is usually cheaper per minute. The choice depends on whether the user needs the transcript while speaking or after the fact.

Custom vocabulary is the single most effective accuracy lever for most products. Adding product names, person names and industry terms to the recogniser removes a large share of the errors that frustrate users. See speech recognition cost for how pricing usually works.

Which approach should you choose?

The right approach depends on your volume, your privacy requirements and how much control you need over the model. Most teams start with a managed API and move only when a specific requirement forces them to.

Approach Best when Trade-off
Managed API You want results this month Per-minute cost, audio leaves your servers
Open model, self-hosted Privacy rules or high volume You run and maintain the infrastructure
On-device Offline use or strict privacy Smaller models, less accuracy on hard audio
Hybrid Mixed needs across features Two systems to maintain

A managed API is the fastest path to a working feature. You send audio, you get a transcript, and the provider handles model updates. The cost scales with usage, which is easy to budget and hard to overspend on by accident.

Self-hosting an open model makes sense when audio cannot leave your environment or when volume is high enough that per-minute pricing exceeds the cost of running your own servers. It also gives you full control over custom vocabulary and model updates, at the price of ongoing maintenance.

On-device recognition suits field work and privacy-sensitive settings, such as a clinician dictating notes or a worker on a site with no signal. Accuracy is lower than a large cloud model, so it fits short commands and structured dictation better than free-form conversation.

How to implement speech recognition step by step

Implementing speech recognition is a sequence of small, testable steps. Each step should work before you move to the next, so a failure is easy to trace.

  1. Define the job. Write down exactly what the transcript is for: search, commands, notes or records. This decides whether you need real-time or batch processing.
  2. Collect real recordings. Gather samples from the actual environment: the microphones, the noise, the accents and the vocabulary your users really use.
  3. Pick the engine. Test two or three options on your recordings and compare accuracy, latency and cost before committing.
  4. Build the capture path. Handle microphone access, recording, upload and storage, including what happens when the network drops mid-recording.
  5. Add custom vocabulary. Load the names, terms and phrases that matter in your domain, then re-test on the same recordings.
  6. Handle the transcript. Store it with timestamps and confidence scores, and build the feature that consumes it: search, commands or a review screen.
  7. Ship to a small group. Release to a few users, watch the error patterns, and fix the most common failures before a wider rollout.

Testing on real recordings matters more than any other step. A demo recorded in a quiet room tells you nothing about how the system behaves on a phone call from a warehouse. For voice products more broadly, how an AI voice agent works explains the surrounding pipeline.

How do you measure accuracy?

You measure speech recognition accuracy with a labelled test set: recordings paired with correct transcripts, scored by word error rate. Word error rate counts substitutions, deletions and insertions as a share of the words in the reference transcript, so a lower rate means a better transcript.

Build the test set from real usage, not from clean demo audio. Include the hard cases: noisy rooms, fast speakers, accented speech and the domain terms your users actually say. A test set of 100 to 200 utterances is enough to compare engines and to catch regressions after a change.

Track accuracy per segment, not just overall. If the system fails on one accent or one product name, an overall score hides it. Segment scores tell you where to add vocabulary or collect more training data.

Also measure what users experience: how often they correct a transcript, how often a voice command fails, and how long the transcript takes to appear. A system with good word error rate but slow delivery still feels broken.

Example: adding voice notes to a support tool

Example (hypothetical): a support team of 12 people wants to dictate case notes instead of typing them after each call. Each agent handles about 20 calls a day, and typing a note takes about 3 minutes per call.

The team records 200 real calls as a test set and tries two managed APIs. The first scores 184 out of 200 utterances correct, the second 191 out of 200, so the team picks the second and adds 60 product names as custom vocabulary. A re-test on the same 200 calls scores 196 out of 200 correct, which is good enough to ship with a review step.

Dictation cuts note time from 3 minutes to about 1 minute per call, including a quick read-through. Across the team that is 12 people times 20 calls times 2 minutes saved, which is 480 minutes, or 8 hours, per day. The team keeps a review screen so an agent can fix the few errors that remain before the note is saved.

The rollout starts with two agents for two weeks. The team watches which product names still fail and adds them to the vocabulary, then rolls out to the rest of the team once corrections fall below one per ten notes.

What are the common mistakes?

The most common speech recognition mistakes are testing on clean audio, skipping custom vocabulary, and shipping without a way to fix errors.

  • Testing on demo audio. Quiet-room recordings flatter every engine and hide the failures your users will hit.
  • Skipping custom vocabulary. Product names and industry terms are the most common errors, and the easiest to fix.
  • No correction path. If users cannot fix a wrong transcript, they stop trusting the feature.
  • Ignoring latency. A transcript that arrives late breaks voice commands and live captions.
  • Storing audio without a policy. Recordings are personal data in many settings, so decide retention and access before you collect them.
  • Choosing on price alone. The cheapest engine on clean audio is often the most expensive in corrections and support tickets.

For help scoping a voice feature, AI voice agent development covers the design and the guardrails around it.

Key takeaways

  • Start with the job the transcript is for, not with the model
  • A managed API is the fastest path; self-host only when privacy or volume demands it
  • Custom vocabulary is the cheapest accuracy win for most products
  • Measure accuracy on real recordings with a fixed test set
  • Always ship a correction path so users can fix the errors that remain

Frequently asked questions

What is word error rate?

Word error rate counts substitutions, deletions and insertions as a share of the words in the correct transcript. It is the standard way to compare speech recognition engines, and you should measure it on your own recordings, not on the vendor's demo set, because accuracy on your audio is what your users experience.

Should I use a managed API or self-host a model?

Use a managed API when you want to ship quickly and your audio can leave your servers. Self-host an open model when privacy rules forbid external processing or when volume is high enough that per-minute pricing costs more than running your own servers.

How much audio do I need to test properly?

A test set of 100 to 200 real utterances is enough to compare engines and catch regressions. Make sure it includes the hard cases: noisy rooms, fast speakers, accented speech and the domain terms your users actually say.

Can speech recognition work offline?

Yes, with on-device models that run on the phone or the device itself. Accuracy is lower than a large cloud model, so offline recognition fits short commands and structured dictation better than free-form conversation.

How do I handle names and product terms?

Add them as custom vocabulary to the recogniser, then re-test on the same recordings. Product names and industry terms are the most common recognition errors and also the easiest to fix this way.

Is recorded audio personal data?

Often, yes. Voice recordings can identify a person, so decide retention, access and deletion rules before you collect them, and check the privacy rules that apply in the places your users live.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a voice feature and unsure which approach fits your product? Talk to Hertiv.

A senior engineer replies within one business day. Or see our AI Voice Agents service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call