New Tool Radar

Local AI

How to Translate Non-English Audio to English with whisper.cpp

Add --translate to your whisper-cli command with a multilingual model, and get English text from a non-English recording instead of a transcript in the original language.

Schematic diagram with three steps: download a multilingual whisper.cpp model, run whisper-cli with -l and --translate, and read the English text in the output.

Transcribing a German interview gives you German text, which is no help if you need to read it in English. whisper.cpp has a built-in answer: the --translate flag, which translates from the source language to English as it transcribes. The project’s own help page lists it as -tr, --translate, and the README’s examples table describes whisper-cli as the tool for translating and transcribing audio using Whisper. This guide is about whisper.cpp’s own translate flag; it is different from the openai-whisper translate guide, which uses the Python whisper command and its --task translate option, a different tool.

Download a multilingual model

The README’s Quick start downloads base.en and runs it on the English jfk.wav sample. For translation, download a multilingual model instead — small is one of the models the README lists. Build the project first if you have not already, with the README’s own commands:

git clone https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp
cmake -B build
cmake --build build -j --config Release

Then download the model:

sh ./models/download-ggml-model.sh small

That gives you models/ggml-small.bin. Convert your recording to 16-bit WAV first if it is not already one — the README’s example uses ffmpeg for that:

ffmpeg -i input.mp3 -ar 16000 -ac 1 -c:a pcm_s16le output.wav

Run whisper-cli with –translate

Add --translate to the usual transcription command, and set the source language with -l. The help page defines the language flag as -l LANG, --language LANG, spoken language, with 'auto' for auto-detect. For a German recording, the command is:

./build/bin/whisper-cli -m ./models/ggml-small.bin -f interview.wav -l de --translate

Use the language code for the language actually spoken — de for German, es for Spanish, fr for French. If you leave -l out, the default is en, so the tool assumes English; telling it the real source language is what makes the translation work. For a practice check, use a short recording in a language you can read, so you can judge whether the English output means the same thing.

Read the English text

The printed output is English text with timestamps, even though the audio was not English. The README’s own log line for a transcription run shows the pattern to look for:

main: processing './samples/jfk.wav' (176000 samples, 11.0 sec), 4 threads, 1 processors, lang = en, task = transcribe, timestamps = 1 ...

On a translate run, that line shows the source language and the translate task instead — lang = de, task = translate for the German example above. Read the English lines in order and check them against the recording: each line should say, in English, what the speaker said at that timestamp. If a line reads as fluent English but means something different from the audio, the translation went wrong at that point, not the transcription.

Try it: four checks

Check What you should see If you do not see it
Model A file called models/ggml-small.bin after the download script Download a multilingual model such as small — the Quick start’s base.en is the model the README uses for its English sample
Flags The command includes both -l de and --translate Without --translate you get a transcript in the original language, not English
Log The log line shows lang = de, task = translate Check the -l value matches the language actually spoken in the recording
Output English text with timestamps, matching what the speaker said Listen to the audio at that timestamp — a fluent but wrong line is a translation error

Expected result. We checked the whisper.cpp README for the Quick start build and download commands, the 16-bit WAV conversion with ffmpeg, the 11.0-second jfk.wav log line with its lang and task fields, and the examples table describing whisper-cli as the tool for translating and transcribing audio; and the whisper-cli help page for the -tr –translate flag defined as translate from source language to english, the -l –language flag with ‘auto’ for auto-detect and its en default, the -m model path, and the -f file path. We did not run whisper.cpp or translate any audio.

Limits

Translation only goes one way: from the source language to English, as the help page defines the flag — there is no flag to translate English audio into another language. The output is a translation by the model, so it can be fluent and still wrong; check it against the audio on material you care about. This is whisper.cpp’s own translate flag, which is different from the openai-whisper translate guide and from plain transcription without the flag. We did not run whisper.cpp, so no translation here is a recorded result.

Sources

See all