Offline Transcription With Whisper.cpp: Voice Activity Detection and Real-Time Output

Offline transcription with whisper.cpp runs fully on your device. Build it, add Silero voice activity detection, and get real-time output from a microphone.

By Galactic News Editorial · Published 2026-11-23T22:52:22+00:00 · Updated 2026-11-23T22:52:22+00:00

Offline transcription with Whisper.cpp and voice activity detection

Offline Transcription With Whisper.cpp: Voice Activity Detection and Real-Time Output

Whisper.cpp runs OpenAI Whisper speech recognition entirely on your own machine. No API key, no cloud upload, no usage bill. Audio goes in, text comes out, and nothing leaves the device. This tutorial builds whisper.cpp from source, adds Silero voice activity detection, and sets up real-time output from a microphone.

Offline transcription Whisper.cpp: what you need

Whisper.cpp is a plain C and C++ port of Whisper with no heavy dependencies. It runs on macOS, Linux, Windows, iOS, Android, and even Raspberry Pi. CPU-only inference works, with GPU acceleration available on Apple Silicon via Metal, NVIDIA via CUDA, and AMD via ROCm. You need a C++ toolchain, CMake, git, and ffmpeg for converting audio. The project is MIT-licensed and lives on GitHub under ggml-org.

Pick a model before you build. Larger models are more accurate and slower. The project documents these sizes.

ModelDiskMemoryBest for
tiny75 MiBAbout 273 MBFast drafts, weak hardware
base142 MiBAbout 388 MBGood balance of speed and accuracy
small466 MiBAbout 852 MBBetter accuracy on a desktop
medium1.5 GiBAbout 2.1 GBHigh accuracy, needs RAM
large2.9 GiBAbout 3.9 GBBest accuracy, 99 languages

English-only variants like base.en are smaller and faster when you only need English. For most developers, base.en is the right start. Independent guides report word error rates around 8.2 percent for tiny.en, 5.9 percent for base.en, and 3.0 percent for large-v3, with tiny and base running in real time on CPU.

Step 1: Clone and build whisper.cpp

  1. Clone the repository: git clone https://github.com/ggml-org/whisper.cpp.git
  2. Move into the directory: cd whisper.cpp
  3. Configure the build: cmake -B build
  4. Build in release mode: cmake --build build -j --config Release
  5. Check the help output: ./build/bin/whisper-cli -h

For a quick demo, run make base.en. That downloads the base.en model and runs inference on the sample audio files in the samples folder. The whole high-level implementation lives in two files, whisper.h and whisper.cpp, with the rest of the code in the ggml tensor library. That small footprint is why the project ports easily to phones, browsers, and embedded boards.

Step 2: Download a model

Download the model you picked with the included script. For base.en, run sh ./models/download-ggml-model.sh base.en. The script saves the model in ggml format under the models folder. You can also download other sizes the same way: tiny.en, small.en, medium.en, large-v3, and large-v3-turbo are all available. Quantized models use less memory and disk, and on some hardware they run faster. Quantize with the included quantize tool, for example ./build/bin/quantize models/ggml-base.en.bin models/ggml-base.en-q5_0.bin q5_0, then pass the quantized file with the -m flag.

Step 3: Transcribe a file

Whisper-cli currently runs only with 16-bit WAV files. Convert your audio first with ffmpeg: ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wav. Then transcribe it: ./build/bin/whisper-cli -m models/ggml-base.en.bin -f output.wav. Add --output-txt to write a plain text file, or --no-timestamps for clean text without time codes. The sample file samples/jfk.wav is a good first test. It should produce the well-known Kennedy line about asking what your country can do for you.

Two limits are worth knowing. Whisper.cpp is inference only: it transcribes, it does not train. And long files take long. A base model on CPU runs near real time, so an hour of audio takes roughly an hour. A GPU or a smaller model cuts that down. Split long recordings into chunks if you need results sooner.

Step 4: Add voice activity detection

Without voice activity detection, Whisper processes silence as if it were speech. That wastes compute and invites hallucinated words during quiet stretches. VAD splits the audio into speech segments first, so Whisper only works on real speech. The project documents this directly, and Silero-VAD is the supported model.

  1. Download the VAD model: ./models/download-vad-model.sh silero-v6.2.0
  2. Run whisper-cli with VAD enabled: ./build/bin/whisper-cli -vm models/ggml-silero-v6.2.0.bin --vad -f samples/jfk.wav -m models/ggml-base.en.bin
  3. Or pass the model with the long flag: --vad-model ./models/silero-v6.2.0-ggml.bin

Five options tune the detector. --vad-threshold sets the speech probability a frame must pass to count as speech. --vad-min-speech-duration-ms discards speech segments shorter than the value, filtering brief noise. --vad-min-silence-duration-ms sets how long silence must last before a segment ends. --vad-max-speech-duration-s splits very long segments at silence points. --vad-speech-pad-ms adds padding before and after each segment so word edges are not cut off. Start with the defaults. Raise the threshold if background noise triggers false speech. Raise the minimum silence duration if short pauses split sentences.

Step 5: Real-time output from a microphone

For live transcription, the project ships a stream example that samples the microphone and transcribes in rolling windows. A common pattern with whisper-cli streams audio in steps: ./build/bin/whisper-cli -m models/ggml-base.en.bin --stream --step 3000 --length 8000. The step value sets how often new audio is processed, in milliseconds. The length value sets the window size. Check ./build/bin/whisper-cli -h on your build, since flags change between versions.

For app integration, run whisper-server instead. Start it with ./build/bin/whisper-server -m models/ggml-base.en.bin --host 0.0.0.0 --port 8178, then send audio to its inference endpoint with a POST request. That gives any local app an HTTP transcription service with no cloud dependency. The examples folder also holds a command example for building a basic offline voice assistant, and bindings exist for Java, Swift, and other languages.

Tuning and common problems

If accuracy is poor, check the audio first. Whisper expects 16 kHz mono input. Resample with ffmpeg before blaming the model. If transcription is slow, drop to a smaller model or a quantized build. If the output invents words during silence, enable VAD. If VAD cuts off word endings, raise the speech padding. If a live stream lags, shorten the window or use the tiny model. On Apple Silicon, build with Core ML support to run the encoder on the Neural Engine, which the project says can run more than three times faster than CPU-only execution.

Bottom line

Offline transcription with whisper.cpp takes four moves: build the project, download a model, convert audio to 16-bit WAV, and transcribe. Add Silero VAD to skip silence and cut hallucinations. Add the stream example or whisper-server for real-time output. Start with base.en, measure accuracy on your own audio, and move to a larger model only when the errors justify the cost.