New Tool Radar

Local AI

How to Transcribe Audio from the Command Line with whisper.cpp

Clone whisper.cpp, build it with CMake, download the base.en model, and transcribe a 16-bit WAV file with whisper-cli — no Python needed.

Schematic diagram with three steps: clone whisper.cpp and download the base.en model, build it with CMake, then transcribe samples jfk.wav with whisper-cli.

OpenAI’s Whisper usually means a Python install, but whisper.cpp is a plain C/C++ port of the same model with no dependencies: clone it, build it with CMake, and run its command-line tool on an audio file. It runs on the CPU, and on Apple Silicon the inference runs on the GPU through Metal. This is the route to take when you want transcription in a terminal, or on a machine where you would rather not install a Python stack.

Clone, download a model, build

These are the README’s own quick-start commands. The download script fetches the base.en model converted to ggml format, and the build produces the whisper-cli tool under build/bin/:

git clone https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp
sh ./models/download-ggml-model.sh base.en
cmake -B build
cmake --build build -j --config Release

The README’s memory table puts base at 142 MiB on disk and about 388 MB of memory; tiny is smaller at 75 MiB and about 273 MB, while large needs 2.9 GiB on disk and about 3.9 GB of memory. Start with base.en unless you have a reason to go bigger or smaller.

Transcribe the sample file

The repository ships a sample recording, samples/jfk.wav, and the README transcribes it with one command:

./build/bin/whisper-cli -f samples/jfk.wav

Note the README’s warning: whisper-cli currently runs only with 16-bit WAV files. Convert anything else first with ffmpeg, using the README’s own example:

ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wav
Check What you should see If you do not see it
Clone The whisper.cpp folder exists with models/ggml-base.en.bin inside The download script did not finish — run it again
Build build/bin/whisper-cli exists The CMake build failed — read the build output
Transcribe whisper-cli prints a transcript for samples/jfk.wav The file is not 16-bit WAV — convert it with ffmpeg first

Expected result. We checked whisper.cpp’s own README for the clone, download, build, and transcribe commands. We did not run whisper.cpp.

Limits

Only the commands and figures above come from the README; the sample transcript is the repository’s own jfk.wav, and no transcription was run for this guide. On Apple Silicon, Core ML can move the encoder to the Neural Engine — the README says it is more than three times faster than CPU-only — but that needs extra setup (a Core ML model generated with generate-coreml-model.sh and a build with -DWHISPER_COREML=1), so it is out of scope here. We did not run whisper.cpp, so no output here is a recorded result.

Sources

See all