New Tool Radar

Local AI

How to Transcribe a Whole Folder of Audio With whisper.cpp

Transcribe every audio file in a folder with one whisper.cpp loop and check each transcript lands.

Schematic with three steps: Convert each file to WAV first; Loop whisper-cli over the folder; Check every transcript landed.

Transcribing recordings one by one wastes an afternoon. A short loop over a folder runs whisper-cli on each file in turn and leaves a transcript next to each recording, which is the same two-command pattern used for video subtitles, repeated for the whole folder.

What you need

  • whisper.cpp built, with whisper-cli available
  • A folder of audio or video files
  • A Whisper model, for example ggml-medium.en-q5_0.bin for English

Step 1: Convert each file to WAV first

For each file, extract the audio as 16-bit WAV with ffmpeg, for example ffmpeg -i video.mp4 -ar 16000 -ac 1 -c:a pcm_s16le video.wav. whisper-cli expects that format.

Step 2: Loop whisper-cli over the folder

Write a short loop that runs whisper-cli -m models/ggml-medium.en-q5_0.bin -f each WAV file with -otxt or -osrt, so each recording gets its own transcript file next to it.

Step 3: Check every transcript landed

List the folder and confirm each recording has a matching transcript file. Open two or three transcripts and spot-check them against the audio before relying on the batch.

Worked example: synthetic folder batch

The table below is a synthetic example. It shows the expected result of batch transcription; no folder was transcribed.

File Transcript Checked?
interview-01.mp4 interview-01.txt Yes, spot-checked
interview-02.mp4 interview-02.txt Yes, spot-checked
interview-03.mp4 interview-03.txt Yes, spot-checked
Total 3 of 3 Pass

Expected result (UNTESTED). all three recordings get a transcript file, and the spot-checked transcripts match the audio. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • A batch takes as long as the recordings are long, so run it when the machine is free.
  • A loop that deletes the WAV files as it goes saves disk, but only do that after the transcripts are checked.
  • One bad file can stop a simple loop; check the output after the first file before leaving the rest to run.

Sources

See all