Whisper Transcription: Local and Cloud Speech-to-Text Compared, with Runnable Scripts
A hands-on guide to Whisper transcription and speech-to-text (STT) in practice: how to transcribe audio locally with OpenAI Whisper, faster-whisper, whisper.cpp, MLX Whisper and NVIDIA Parakeet, when a cloud speech-to-text API (OpenAI, Deepgram, AssemblyAI, Google, AWS, Azure and others) is the better choice, and how to get accurate transcripts and subtitles. Includes runnable scripts, a dependency-free WER calculator, SRT/VTT subtitle tools and long-audio chunking helpers.
For developers, podcasters, researchers and anyone building transcription into an app.
Last reviewed: December 2026. Model names, prices and limits in this field change often. Where this guide names a model or limit, it was checked against the provider’s docs at review time; always confirm on the linked pages before relying on it. This is an independent project and is not affiliated with OpenAI or any provider named here.
Table of Contents
- Quick decision guide
- How modern speech recognition works
- Local engines
- Cloud speech-to-text APIs
- Local vs cloud: side-by-side
- Runnable scripts in this repo
- Accuracy playbook
- Long recordings
- Speaker diarization
- Subtitles that people can read
- Measuring accuracy (WER and CER)
- Real-time and streaming
- Privacy, consent and compliance
- Best picks
- Engine feature comparison
- Speed expectations
- Translation and multilingual audio
- A batch transcription pipeline
- FFmpeg cheat sheet for speech
- Choosing a cloud API: evaluation checklist
- Domain vocabulary: practical examples
- Glossary
- FAQ
- Where to go next
- Troubleshooting
- Resources
- Contributing
- License
- More free resources
Quick decision guide
| Your situation | Good starting point |
|---|---|
| Laptop, occasional files, want privacy | faster-whisper with the turbo model (CPU int8 works), or whisper.cpp |
| Mac with Apple silicon | mlx-whisper or whisper.cpp (Metal) |
| NVIDIA GPU, lots of English audio, max speed | NVIDIA Parakeet via NeMo, or faster-whisper batched mode |
| Many languages, mixed accents | Whisper large-v3 or turbo locally, or a multilingual cloud model |
| Need speaker labels (“who said what”) | WhisperX + pyannote locally, or a cloud API with diarization |
| Phone calls (8 kHz), noisy contact center audio | A cloud API with telephony-tuned models; test on your own calls |
| Live captions, voice agents | A streaming API or a streaming-capable local model (see Real-time) |
| No servers, no GPU, minimal setup | A cloud API with per-minute billing |
| Regulated data (health, legal) | Local, or a cloud vendor with the right contract (BAA, DPA, data residency) |
How modern speech recognition works
Most current systems are neural encoder-decoder or transducer models trained on hundreds of thousands of hours of audio.
- Whisper (OpenAI, 2022; paper, code) converts audio to a log-Mel spectrogram, processes 30-second windows with a Transformer encoder, and a decoder writes text tokens, including language, timestamps and task tokens. It is multilingual and can translate speech into English.
- Transducer and CTC models (for example NVIDIA’s Parakeet family) emit text frame by frame. They tend to be very fast and less prone to “inventing” text, and are often English-first or cover a smaller set of languages.
Consequences you will notice in practice:
- Long audio is processed in windows. Engines stitch windows together using timestamps; errors cluster at boundaries.
- Silence and music can cause hallucinations in Whisper-style decoders (repeated phrases, “Thank you for watching”). Voice activity detection (VAD) before decoding is the main fix.
- The decoder is a language model. It writes fluent text, which is great for punctuation and terrible when it fills gaps confidently. Always spot-check.
- Context helps. A prompt with names and jargon biases spelling.
Local engines
OpenAI Whisper (reference implementation)
The original PyTorch implementation. Easiest to understand, slower than optimized ports.
pip install -U openai-whisper # also needs ffmpeg on your PATH
whisper interview.mp3 --model turbo --language en --output_format srt
whisper lecture_fr.mp3 --model large-v3 --task translate # French audio -> English text
import whisper
model = whisper.load_model("turbo")
result = model.transcribe("interview.mp3", language="en", word_timestamps=True)
print(result["text"])
Use it when you want the reference behavior or to read the code. For production speed, use one of the ports below.
faster-whisper
faster-whisper reimplements Whisper on CTranslate2. It is typically several times faster than the reference implementation at similar accuracy and supports int8 quantization on CPU and GPU. Audio decoding uses PyAV, so a system ffmpeg is not required.
from faster_whisper import WhisperModel
model = WhisperModel("turbo", device="cpu", compute_type="int8") # GPU: device="cuda", compute_type="float16"
segments, info = model.transcribe("meeting.mp3", beam_size=5, vad_filter=True, word_timestamps=True)
print(info.language, round(info.language_probability, 2))
for s in segments: # generator: decoding happens while you iterate
print(f"[{s.start:6.1f} -> {s.end:6.1f}] {s.text}")
Useful options: vad_filter=True (Silero VAD removes silence), language="en" (skip detection), initial_prompt="..." (vocabulary hint), condition_on_previous_text=False (reduces repetition loops), and BatchedInferencePipeline for higher GPU throughput. GPU use requires CUDA 12 and cuDNN 9 libraries for current versions; see the project README.
Script: scripts/transcribe_faster_whisper.py writes .txt, .srt and .vtt.
whisper.cpp
whisper.cpp is a C/C++ port with no Python dependency. It runs on CPUs, Apple Metal, CUDA, Vulkan and more, and quantized models make it practical on small machines.
git clone https://github.com/ggml-org/whisper.cpp && cd whisper.cpp
cmake -B build && cmake --build build -j --config Release
sh ./models/download-ggml-model.sh large-v3-turbo
ffmpeg -i talk.mp3 -ar 16000 -ac 1 -c:a pcm_s16le talk.wav # 16 kHz mono WAV input
./build/bin/whisper-cli -m models/ggml-large-v3-turbo.bin -f talk.wav -l auto -osrt -otxt
Script: scripts/transcribe_whispercpp.sh handles conversion and outputs.
MLX Whisper (Apple silicon)
mlx-whisper runs Whisper on Apple’s MLX framework and uses the Mac GPU through unified memory.
pip install mlx-whisper
mlx_whisper lecture.m4a --model mlx-community/whisper-large-v3-turbo
import mlx_whisper
out = mlx_whisper.transcribe("lecture.m4a", path_or_hf_repo="mlx-community/whisper-large-v3-turbo")
print(out["text"])
The package default is a tiny model, so pass a larger one explicitly. Script: scripts/transcribe_mlx.py.
WhisperX (alignment and speakers)
WhisperX combines faster Whisper inference with forced alignment (accurate word timestamps from a phoneme model) and speaker diarization via pyannote.audio. It is a common choice for interview and meeting transcripts with speaker labels. Diarization models from pyannote require accepting their terms on Hugging Face and using an access token.
NVIDIA Parakeet and other non-Whisper models
-
Parakeet TDT (
nvidia/parakeet-tdt-0.6b-v2for English,nvidia/parakeet-tdt-0.6b-v3for 25 European languages) is a 600M-parameter transducer model with punctuation, capitalization and word timestamps. It is very fast on NVIDIA GPUs and ranks highly on public English benchmarks. Run it with NeMo:import nemo.collections.asr as nemo_asr model = nemo_asr.models.ASRModel.from_pretrained(model_name="nvidia/parakeet-tdt-0.6b-v2") print(model.transcribe(["call.wav"])[0].text)Check the model card for the license and supported languages before production use.
- Distil-Whisper (repo): distilled Whisper variants that are faster with small accuracy loss, mainly for English.
- Vosk (repo): lightweight offline recognizer for Raspberry Pi, Android and servers; lower accuracy than Whisper-class models but tiny and streaming-friendly.
Compare models on the Hugging Face Open ASR Leaderboard, then on your own audio (leaderboards use clean public test sets).
Whisper model sizes
| Model | Parameters | Multilingual | Notes |
|---|---|---|---|
tiny / tiny.en |
~39M | yes / English only | Fast, noticeably less accurate |
base / base.en |
~74M | yes / English only | Good for quick drafts |
small / small.en |
~244M | yes / English only | Reasonable on CPU |
medium / medium.en |
~769M | yes / English only | Better accuracy, slower |
large-v3 |
~1.55B | yes | Most accurate original Whisper, slowest |
turbo (large-v3-turbo) |
~809M | yes | Pruned decoder: much faster than large-v3, close in accuracy for transcription; not trained for translation |
.en models are a bit better for English-only audio at the smaller sizes. Quantized versions (int8, or GGML/GGUF q5/q8 in whisper.cpp) cut memory substantially with small accuracy changes; measure on your data.
Cloud speech-to-text APIs
Cloud APIs remove setup and hardware cost and often add features (diarization, PII redaction, summaries, streaming, custom vocabulary). You pay per audio minute or hour and send audio to a third party.
| Provider | Product | Notable features | Docs |
|---|---|---|---|
| OpenAI | Audio transcriptions API | Simple upload API; current model at review time gpt-transcribe; older whisper-1 and gpt-4o-*-transcribe models marked deprecated with a shutdown date |
Speech to text guide |
| Deepgram | Pre-recorded and streaming STT (Nova-3 models) | Fast, diarization, smart formatting, keyterm prompting, streaming | Docs |
| AssemblyAI | Speech-to-text API | Diarization, PII redaction, many audio intelligence add-ons, streaming | Docs |
| Google Cloud | Speech-to-Text (Chirp models) | Many languages, data residency options | Docs |
| AWS | Amazon Transcribe | Call analytics, medical variant, custom vocabularies | Docs |
| Microsoft | Azure AI Speech | Batch and real-time, custom speech models, diarization | Docs |
| ElevenLabs | Speech to Text (Scribe) | Multilingual, word timestamps, speaker labels | Docs |
| Groq | Hosted Whisper models | Very fast hosted Whisper through an OpenAI-compatible endpoint | Docs |
| Speechmatics | Batch and real-time ASR | Broad language and accent coverage | Docs |
Notes:
- Upload limits: for example, OpenAI’s transcription endpoint accepts files up to 25 MB at review time. Compress (mono, 16 kHz, 32 to 64 kbps MP3 or Opus is fine for speech) or split long files. Several providers accept a public URL instead of an upload for large files.
- Pricing models differ: per second vs per 15-second increment, batch vs streaming rates, add-on features billed separately. Compare on the providers’ current pricing pages with your expected monthly hours.
- Deprecations happen. Keep the model name in configuration, not code, and watch provider changelogs.
Scripts: scripts/transcribe_openai_api.py (any OpenAI-compatible transcription endpoint, via --base-url) and scripts/transcribe_deepgram.py. Both use only the Python standard library.
Local vs cloud: side-by-side
| Factor | Local (Whisper, Parakeet, …) | Cloud API |
|---|---|---|
| Privacy | Audio never leaves your machine | Audio sent to a vendor; check retention and training policies |
| Cost at low volume | Free (your hardware and electricity) | Cheap, pay per minute |
| Cost at high volume | Fixed hardware cost; very cheap per hour once you own a GPU | Grows linearly with hours |
| Setup | Python/C++ install, models to download, GPU drivers | API key and an HTTP call |
| Speed | Depends on hardware; GPU is many times faster than real time | Fast, parallel, no hardware limits |
| Features | Transcription and timestamps; diarization via extra tools | Diarization, redaction, summaries, streaming often built in |
| Languages | Whisper covers ~100 languages with varying quality | Varies by provider and model |
| Offline | Yes | No |
| Control | Full: pin versions, tune decoding, fine-tune | Limited to exposed parameters; model can change under you |
A common hybrid: run local transcription by default and send only difficult or high-value audio (bad phone lines, critical meetings) to a cloud API.
Runnable scripts in this repo
whisper-transcription/
├── stt/ # dependency-free helpers (tested)
│ ├── wer.py # WER / CER with alignment and normalization
│ ├── subtitles.py # SRT / WebVTT writer, line wrapping, segment splitting
│ └── chunking.py # overlapping chunk plan, ffmpeg commands, transcript stitching
├── scripts/
│ ├── transcribe_faster_whisper.py # local, CPU or CUDA (pip install faster-whisper)
│ ├── transcribe_mlx.py # local, Apple silicon (pip install mlx-whisper)
│ ├── transcribe_whispercpp.sh # local, C++ build + ffmpeg
│ ├── transcribe_openai_api.py # cloud, OpenAI-compatible API (stdlib only)
│ ├── transcribe_deepgram.py # cloud, Deepgram (stdlib only)
│ └── wer_report.py # compare transcripts against a reference
└── tests/test_stt.py # unit tests; API clients tested against a local fake server
Examples:
# Local, CPU
pip install faster-whisper
python3 scripts/transcribe_faster_whisper.py podcast.mp3 --model turbo --language en --out-dir out/
# Cloud
export OPENAI_API_KEY=...
python3 scripts/transcribe_openai_api.py podcast.mp3 --model gpt-transcribe --prompt "Kubernetes, Postgres, Ralpberry"
export DEEPGRAM_API_KEY=...
python3 scripts/transcribe_deepgram.py call.wav --diarize
# Score them against a hand-corrected reference
python3 scripts/wer_report.py reference.txt out/podcast.txt openai.txt deepgram.txt
Run the tests (standard library only; no models or API keys needed):
python3 -m unittest discover -s tests
The local engine scripts need their packages installed and download models on first run; they are not exercised by the unit tests beyond --help.
Accuracy playbook
Ordered by impact per minute of effort.
1. Fix the audio first.
# Mono, 16 kHz, gentle high-pass to cut rumble, loudness normalization
ffmpeg -i raw.m4a -ac 1 -ar 16000 -af "highpass=f=80,loudnorm=I=-16:TP=-1.5:LRA=11" clean.wav
- Record closer to the mouth; a cheap lavalier beats an expensive room mic.
- Separate tracks per speaker (podcast recorders, Zoom “separate audio files”) make diarization trivial.
- Avoid heavy noise suppression that creates artifacts; mild denoising is fine.
2. Tell the model the language. Auto-detection on the first 30 seconds can pick the wrong language when a recording starts with music or a greeting in another language.
3. Give vocabulary context. Pass names, product terms and acronyms as initial_prompt (Whisper ports) or prompt (OpenAI API), or use the provider’s custom vocabulary / keyterm feature. Keep it short and natural: "Speakers: Priya Raman, Tomasz Nowak. Topics: Kubernetes, gRPC, Postgres."
4. Use VAD. Removing silence and music before decoding reduces hallucinated text and speeds things up (vad_filter=True in faster-whisper; WhisperX uses VAD-based segmentation).
5. Pick the right model size. Going from small to turbo or large-v3 usually helps more than any decoding parameter. Beam search (beam_size=5) helps a little over greedy decoding.
6. Stop repetition loops. If a transcript repeats a phrase over and over, set condition_on_previous_text=False (Whisper ports), keep VAD on, and check for long silences or music in the audio.
7. Post-process deliberately. A find-and-replace table for recurring misspellings of names is cheap and reliable. An LLM clean-up pass can fix punctuation and casing, but instruct it not to change wording, and diff the result.
8. Measure. Hand-correct 10 to 20 minutes of representative audio and compute WER for each option (below). Your audio is not a benchmark dataset.
Long recordings
Local engines handle hours of audio natively (they stream through 30-second windows). Cloud APIs with upload limits need splitting:
from stt import plan_chunks, ffmpeg_chunk_commands, stitch_texts
chunks = plan_chunks(duration=5400, chunk_len=600, overlap=5) # 90 min -> 10 min windows, 5 s overlap
for cmd in ffmpeg_chunk_commands("town_hall.m4a", chunks):
print(cmd) # run these, transcribe each chunk_###.mp3
full_text = stitch_texts([open(f"chunk_{i:03d}.txt").read() for i in range(len(chunks))])
- The overlap keeps words cut at a boundary in at least one chunk;
stitch_textsdrops the duplicated words at each join. - Better still, cut at silences (detect with
ffmpeg -af silencedetect=noise=-35dB:d=0.5 -f null -) so no word is split. - Offset each chunk’s timestamps by its start time before merging subtitle segments.
Speaker diarization
Diarization answers “who spoke when”. It is a separate problem from transcription and the usual weak point.
| Approach | How |
|---|---|
| Separate tracks | Record each speaker separately; transcribe each track; merge by timestamp. Most accurate |
| Local pipeline | WhisperX (Whisper + alignment + pyannote diarization), or pyannote directly and merge with your transcript |
| Cloud | Enable diarization in the API (Deepgram diarize=true, AssemblyAI speaker labels, and similar) |
Tips: tell the system the number of speakers if you know it; diarization struggles with overlapping speech and short back-and-forth turns; label speakers by name afterwards with a quick manual pass or by matching voice samples where your tool supports it.
Subtitles that people can read
stt.subtitles writes SRT and WebVTT and splits long segments using word timestamps when available.
from stt import Segment, split_long_segments, to_srt
segments = [Segment(0.0, 9.8, "A long sentence from the transcriber ...", words=word_timings)]
open("talk.srt", "w").write(to_srt(split_long_segments(segments, max_chars=84, max_duration=7.0)))
Common readability guidelines (broadcasters publish their own style guides; adapt to yours):
- At most 2 lines, around 37 to 42 characters per line.
- Each subtitle on screen for roughly 1 to 7 seconds.
- Reading speed around 15 to 20 characters per second for adult audiences.
- Break lines at natural phrase boundaries, not mid-phrase.
- Use speaker labels or dashes when two people speak in one subtitle.
SRT uses 00:01:02,500 (comma) timestamps; WebVTT uses 00:01:02.500 (period) and starts with a WEBVTT header. Browsers’ <track> element needs WebVTT.
Measuring accuracy (WER and CER)
Word error rate: WER = (S + D + I) / N where S, D and I are word substitutions, deletions and insertions in the minimum-edit alignment, and N is the number of words in the reference. Lower is better; it can exceed 100% when the hypothesis adds many words.
from stt import wer, cer
r = wer("The meeting starts at 9 a.m.", "the meeting start at nine am")
print(f"{r.wer:.1%}", r.substitutions, r.deletions, r.insertions)
python3 scripts/wer_report.py reference.txt faster_whisper.txt openai.txt --show-errors
Doing it properly:
- Normalize both sides identically (case, punctuation, apostrophes).
stt.normalizeis a simple starting point. Numbers (“9 a.m.” vs “nine am”) and spelling variants still count as errors unless you normalize them too; extend the replacement table for your domain. - Use CER for languages without spaces (Chinese, Japanese, Thai).
- Report by condition (clean vs noisy, accent, speaker) rather than one average.
- Read the errors. A 5% WER where every error is a customer’s name is worse for you than 8% WER on filler words.
- For larger evaluations, the
jiwerpackage and the normalizers used by the Open ASR Leaderboard are standard tools.
Real-time and streaming
Batch transcription (upload a file, get text) is the simple case. Live captions and voice agents need streaming: audio sent in small frames over a WebSocket, with interim (changing) and final results.
- Cloud streaming APIs: most providers above offer one; latency, endpointing (deciding when a speaker finished) and pricing differ.
- Local streaming: Whisper was not designed for streaming, but projects re-run it on a sliding window (whisper.cpp includes a
streamexample), and transducer models such as Parakeet are naturally better suited. Expect trade-offs between latency and accuracy. - For voice agents, endpointing and turn detection matter as much as WER. Test with real interruptions and pauses.
Privacy, consent and compliance
- Consent: many jurisdictions require consent from all parties to record a conversation. Know the law where you and the speakers are.
- Vendor terms: check whether a cloud provider stores audio, for how long, and whether it is used for training; most offer opt-outs or zero-retention options for business accounts.
- Sensitive data: for health, legal or financial audio, use local processing or a vendor contract that covers it (for example a BAA for HIPAA in the US, a DPA under GDPR in the EU).
- Redaction: remove PII from transcripts before storing or sending them to other systems (several APIs offer PII redaction; locally, run a named-entity pass).
- Retention: delete raw audio when you no longer need it; transcripts are often enough.
Best picks
| Goal | Pick | Why |
|---|---|---|
| Best default for most people, local | faster-whisper + turbo |
Fast on CPU (int8) and GPU, near large-v3 accuracy for transcription |
| Maximum multilingual accuracy, local | Whisper large-v3 (via faster-whisper or whisper.cpp) |
Strongest original Whisper model across languages |
| Mac laptop | mlx-whisper or whisper.cpp with Metal | Uses the Apple GPU |
| Raspberry Pi, phones, tiny servers | whisper.cpp quantized base/small, or Vosk |
Small memory, no Python needed (whisper.cpp) |
| Highest English throughput on NVIDIA | Parakeet TDT via NeMo | Transducer model, very fast, strong English accuracy |
| Interviews and meetings with speaker labels | WhisperX, or a cloud API with diarization | Word alignment plus diarization |
| No setup, pay per minute | A cloud API (OpenAI, Deepgram, AssemblyAI, Google, AWS, Azure, ElevenLabs) | HTTP call, features included |
| Live captions | A streaming cloud API, or a streaming-capable local model | Low latency with interim results |
| Subtitles for video | faster-whisper with word_timestamps=True + stt.subtitles |
Accurate timing and readable line breaks |
Engine feature comparison
| Feature | openai-whisper | faster-whisper | whisper.cpp | mlx-whisper | WhisperX | Parakeet (NeMo) |
|---|---|---|---|---|---|---|
| Language | Python (PyTorch) | Python (CTranslate2) | C/C++ | Python (MLX) | Python | Python (PyTorch) |
| CPU | Yes (slow) | Yes (int8) | Yes (fast) | No (Apple silicon) | Yes | Possible, slow |
| NVIDIA GPU | Yes | Yes | Yes (CUDA) | No | Yes | Yes (best) |
| Apple GPU | Limited | No | Yes (Metal) | Yes | No | No |
| Word timestamps | Yes | Yes | Yes | Yes | Yes (forced alignment) | Yes |
| Built-in VAD | No | Yes (Silero) | Yes (optional) | No | Yes | No |
| Diarization | No | No | Limited (stereo/tinydiarize) | No | Yes (pyannote) | Via NeMo pipelines |
| Translation to English | Yes | Yes | Yes | Yes | Yes | No |
| Needs ffmpeg | Yes | No (PyAV) | For non-WAV input | Yes | Yes | For non-WAV input |
| Languages | ~100 | ~100 | ~100 | ~100 | ~100 (alignment models per language) | English (v2), 25 European (v3) |
Speed expectations
Speed is usually reported as a real-time factor (RTF): processing time divided by audio duration. RTF 0.1 means one hour of audio in six minutes.
Rough, hardware-dependent expectations for the turbo/large-v3 class:
| Hardware | Typical experience |
|---|---|
| Modern laptop CPU, faster-whisper int8 | Around real time to a few times faster than real time for turbo; much faster for small |
| Apple silicon with mlx-whisper or whisper.cpp Metal | Many times faster than real time |
| Recent NVIDIA GPU with faster-whisper (batched) | Tens of times faster than real time |
| NVIDIA GPU with Parakeet | Among the fastest options for English |
Measure on your own files: time python3 scripts/transcribe_faster_whisper.py sample.mp3 --model turbo and divide by the audio length.
Translation and multilingual audio
- Whisper models can translate speech to English with
--task translate(openai-whisper) ortask="translate"(faster-whisper). Theturbomodel was not trained for translation; uselarge-v3ormediumfor that. - For other target languages, transcribe in the source language, then translate the text with a language model or a translation API, keeping timestamps per segment.
- Code-switching (speakers mixing languages) is hard for every engine. Leaving language detection on per segment, or using a multilingual cloud model, helps.
- For low-resource languages, test several models; quality varies far more across languages than across engines.
A batch transcription pipeline
A pattern for transcribing a folder of recordings reliably:
# 1. Normalize audio (mono 16 kHz, loudness) into a work folder
mkdir -p work out
for f in recordings/*; do
ffmpeg -hide_banner -loglevel error -y -i "$f" -ac 1 -ar 16000 -af loudnorm "work/$(basename "${f%.*}").wav"
done
# 2. Transcribe each file (skip ones already done, so the job can resume)
for f in work/*.wav; do
base="out/$(basename "${f%.*}")"
[ -f "$base.srt" ] && continue
python3 scripts/transcribe_faster_whisper.py "$f" --model turbo --language en --out-dir out/
done
# 3. Spot-check accuracy on a hand-corrected sample
python3 scripts/wer_report.py reference/sample1.txt out/sample1.txt --show-errors
Add: a manifest (CSV of file, duration, language, engine, WER on spot checks), retention rules for raw audio, and a queue if several machines share the work.
FFmpeg cheat sheet for speech
# Inspect a file (duration, codec, sample rate, channels)
ffprobe -hide_banner -show_entries format=duration:stream=codec_name,sample_rate,channels -of default=nw=1 input.m4a
# 16 kHz mono WAV (what most local engines want internally)
ffmpeg -i input.m4a -ac 1 -ar 16000 -c:a pcm_s16le out.wav
# Small upload for a cloud API (mono 16 kHz, 48 kbps MP3 is plenty for speech)
ffmpeg -i input.wav -ac 1 -ar 16000 -c:a libmp3lame -b:a 48k out.mp3
# Opus in Ogg: even smaller at similar quality
ffmpeg -i input.wav -ac 1 -ar 16000 -c:a libopus -b:a 24k out.ogg
# Extract the audio track from a video
ffmpeg -i talk.mp4 -vn -ac 1 -ar 16000 talk.wav
# Keep only the left channel (for example, one speaker per channel in call recordings)
ffmpeg -i call.wav -af "pan=mono|c0=c0" left.wav
# Trim: from 00:05:00 for 10 minutes
ffmpeg -ss 00:05:00 -t 600 -i long.mp3 -c copy part.mp3
# Find silences to cut long files at natural pauses
ffmpeg -i long.wav -af silencedetect=noise=-35dB:d=0.6 -f null - 2>&1 | grep silence_end
# Gentle cleanup: remove rumble, normalize loudness
ffmpeg -i raw.wav -af "highpass=f=80,loudnorm=I=-16:TP=-1.5:LRA=11" clean.wav
# Speed up playback for faster review of a transcript (does not change pitch)
ffmpeg -i talk.wav -filter:a "atempo=1.5" talk_fast.wav
Choosing a cloud API: evaluation checklist
Run the same 30 to 60 minutes of representative audio through each candidate and record:
| Criterion | How to check |
|---|---|
| Accuracy (WER) on your audio | scripts/wer_report.py against a hand-corrected transcript |
| Accuracy on names and jargon | Count errors on a list of your domain terms; test custom vocabulary or prompting features |
| Diarization quality | Speaker-attributed WER, or manual check of speaker turns |
| Timestamps | Spot-check 10 random words in a player |
| Latency | Time from upload to result (batch) or to final transcript (streaming) |
| Languages and accents you need | Include them in the test set |
| Formats and limits | Max file size and duration, URL ingestion, supported codecs |
| Data handling | Retention period, training use opt-out, region, certifications, contract terms (DPA, BAA) |
| Pricing | Per-minute rate, rounding increments, add-on features billed separately, volume discounts |
| Reliability | Rate limits, status page history, SLA |
Keep the test set and the results table in your repository so you can re-run the comparison when providers release new models.
Domain vocabulary: practical examples
How to give an engine your vocabulary, by tool:
| Tool | Mechanism | Example |
|---|---|---|
| openai-whisper / faster-whisper | initial_prompt text |
initial_prompt="Kubernetes, kubectl, etcd, Istio, gRPC, Priya Raman" |
| whisper.cpp | --prompt |
whisper-cli ... --prompt "Kubernetes, kubectl, etcd" |
| OpenAI transcription API | prompt field |
names and terms in a short sentence |
| Deepgram (Nova-3) | keyterm prompting parameter | key terms per request (see docs) |
| Other cloud APIs | custom vocabulary, phrase lists or boosting | see each provider’s docs |
Tips: use terms exactly as they should be spelled, keep lists short (dozens, not thousands), and remove terms that cause false insertions. For very large vocabularies (product catalogs), post-correct with a fuzzy-matching pass against your catalog instead.
Glossary
- ASR (automatic speech recognition): converting speech audio to text.
- STT (speech-to-text): same as ASR, common in product names.
- WER / CER: word or character error rate; lower is better.
- VAD (voice activity detection): detecting which parts of audio contain speech.
- Diarization: labeling who spoke when.
- Forced alignment: matching a known transcript to audio to get precise word timings.
- RTF (real-time factor): processing time divided by audio duration.
- Beam search: decoding that keeps several candidate transcripts and picks the most likely.
- Quantization: storing model weights at lower precision (int8, q5) to save memory and speed up inference.
- Streaming ASR: transcribing audio as it arrives, with interim and final results.
FAQ
Is Whisper free to use? The open-source Whisper code and weights are released under the MIT license and run locally for free. Hosted Whisper-based APIs charge per minute of audio.
What is the most accurate speech-to-text model? It depends on language, audio quality and domain. Public leaderboards show the current leaders on clean English benchmarks; on your own noisy, accented or domain-specific audio, results can reorder. Test two or three options on 15 minutes of your audio.
Which Whisper model should I use?
turbo for most transcription, large-v3 for the best multilingual accuracy or for translation, small or base for weak hardware. Use .en variants for English-only audio at small sizes.
Can Whisper identify speakers? Not by itself. Combine it with diarization (WhisperX with pyannote) or use an API that offers speaker labels.
Why does Whisper invent text during silence? The decoder is a language model that continues fluent text when there is no speech. Use VAD, trim long silences and music, and disable conditioning on previous text if repetition appears.
How do I transcribe a 3-hour recording with an API that has a size limit? Compress to mono low-bitrate audio, or split into overlapping chunks at silences, transcribe each, and stitch the text (Long recordings).
Can I run speech-to-text on a phone or Raspberry Pi? Yes, with whisper.cpp and a small quantized model, or Vosk. Expect lower accuracy than large models.
How do I get subtitles (SRT) from audio?
Use an engine with word timestamps, split long segments to readable lengths, and write SRT. scripts/transcribe_faster_whisper.py and scripts/transcribe_whispercpp.sh both output SRT and VTT.
Is it legal to transcribe calls or meetings? Recording and transcription laws vary; some places require consent from every participant. Inform participants and follow local law and your company policy.
How do I measure accuracy? Compute WER (and CER for languages without spaces) against a careful human transcript, after normalizing both texts the same way. Read the actual errors, not only the number.
Where to go next
- Transcribe 10 minutes of your own audio with two engines and compare with
scripts/wer_report.py. - Read the Whisper paper sections on long-form transcription and robustness.
- Check the Open ASR Leaderboard for new open models, then test the promising ones on your data.
- Add diarization with WhisperX for meetings and interviews.
- For voice agents and live captions, explore streaming APIs and frameworks such as Pipecat and LiveKit Agents.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Same sentence repeated many times | Decoder loop on silence or music | VAD on, condition_on_previous_text=False, trim silence |
| Text appears where nobody speaks (“Thanks for watching”) | Hallucination on non-speech | VAD, raise no-speech threshold, cut intros and music |
| Wrong language detected | Auto-detect on a misleading opening | Pass language explicitly |
| Names misspelled consistently | Unknown vocabulary | Prompt or custom vocabulary; replacement table after |
ffmpeg not found |
openai-whisper and whisper.cpp conversions need it | Install ffmpeg (brew install ffmpeg, apt install ffmpeg) |
| faster-whisper CUDA errors about cuDNN or cuBLAS | Library version mismatch | Install CUDA 12 / cuDNN 9 libraries as its README describes, or use CPU int8 |
| API returns 413 or a size error | File above the upload limit | Compress to mono low-bitrate MP3 or split (see Long recordings) |
| Timestamps drift in subtitles | Segment-level timing, long segments | Use word timestamps (faster-whisper word_timestamps=True, WhisperX alignment) |
| Very slow on CPU | Large model, float32 | turbo or small, compute_type="int8", or whisper.cpp quantized models |
Resources
- Robust Speech Recognition via Large-Scale Weak Supervision (Whisper paper) and openai/whisper
- SYSTRAN/faster-whisper
- ggml-org/whisper.cpp
- m-bain/whisperX
- pyannote/pyannote-audio
- NVIDIA/NeMo
- huggingface/distil-whisper
- alphacep/vosk-api
- jitsi/jiwer (WER toolkit)
- Hugging Face Open ASR Leaderboard
- FFmpeg documentation
Contributing
PRs are welcome: new engines or providers (with a working script and a test where possible), accuracy tips backed by measurements, and corrections when models or APIs change. Please keep entries accurate, cite official docs, keep the stt/ package standard-library only, and run python3 -m unittest discover -s tests before submitting.
License
Code and guide are released under the MIT License. Models and APIs you use have their own licenses and terms.
If this helped you, a star helps others find it.
More free resources
Part of the Ralpberry Labs open-source collection. See also Top 100 Open Source.