New Tool Radar

Local AI

Transcribe an Audio File Locally with faster-whisper in Python

Install faster-whisper, convert audio to 16 kHz mono WAV, and transcribe it in Python with timestamps.

Schematic with three steps: Install and prepare the audio; Transcribe with a small script; Read the segments.

faster-whisper reimplements Whisper on CTranslate2 and runs up to four times faster than the original, using less RAM, with a plain Python API. It runs fully locally, so no audio leaves your machine.

What you need

  • Python 3.8 or newer with pip
  • FFmpeg and the pydub library for audio conversion
  • An audio file to transcribe, such as an MP3 or WAV

Step 1: Install and prepare the audio

Run pip install faster-whisper and pip install pydub. Whisper expects 16 kHz mono WAV, so convert other formats first, for example with pydub by setting channels to 1 and frame rate to 16000 before exporting as WAV.

Step 2: Transcribe with a small script

Run: from faster_whisper import WhisperModel; model = WhisperModel(‘base’, device=’cpu’, compute_type=’int8′); segments, info = model.transcribe(‘my_recording.wav’, beam_size=5, language=’en’). The model downloads on first use. Beam size 5 balances accuracy and speed.

Step 3: Read the segments

Iterate over segments and print each one with its start and end times, for example [0.00s -> 4.20s] followed by the text. The generator does the actual work when iterated, so time that loop, not the transcribe call. Join the segment texts for the full transcript.

Worked example: transcribe a 10-minute meeting recording

The table below is a synthetic example. The code shape, the int8 setting, and the speed note come from the cited faster-whisper guides; the times are illustrative.

Step Value Expected result
Convert MP3 to 16 kHz mono WAV my_recording.wav ready
Model base, cpu, int8 Downloads once, then loads
Transcribe beam_size 5, language en Segments with timestamps

Expected result (UNTESTED). the script prints the detected language and a transcript made of timestamped segments, finishing a 10-minute file in about two minutes on a modern CPU. This check was not run live; the code and speed note come from the cited faster-whisper guides.

Limits

  • The model downloads on first use and needs internet for that step.
  • Faster-whisper has no speaker labels; diarization needs a separate model.
  • Timestamps are estimates and need review before becoming captions.
  • Very noisy audio or heavy accents raise the error rate; try a larger model.

Sources

See all