New Tool Radar

Local AI

How to Install OpenAI Whisper in Python and Transcribe Audio

Install the openai-whisper Python package, transcribe one audio file locally, and check the output files.

Schematic with three steps: Install the package; Transcribe one file with the base model; Check the output files.

OpenAI Whisper as a Python package is the simplest route to local transcription when you already work in Python: one pip install, one command, and the transcript lands as text, SRT, and VTT files. The model runs on your machine, with a GPU used if one is available.

What you need

  • Python 3.8 or newer and ffmpeg installed
  • An internet connection for the install and the first model download
  • An audio or video file to transcribe

Step 1: Install the package

Run pip install openai-whisper in a terminal. The install also pulls in the packages Whisper needs, including ffmpeg support for reading audio files.

Step 2: Transcribe one file with the base model

Run whisper audio.mp3 –model base, using your own file. Whisper detects the language automatically and writes the transcript files next to the audio.

Step 3: Check the output files

Open the .txt transcript and confirm it matches the audio, and check the .srt file if you need subtitles. The base model is the recommended starting point; larger models are more accurate but slower.

Worked example: synthetic Python Whisper run

The table below is a synthetic example. It shows the expected result of transcribing with openai-whisper; no audio was transcribed.

Check Expected Result
pip install openai-whisper Installs Pass
whisper file –model base Transcribes Pass
Output files .txt, .srt, .vtt written Pass
Transcript checked Matches audio Pass

Expected result (UNTESTED). the package installs, the base model transcribes the file, the output files are written, and the transcript matches the audio. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • The base model has 74 million parameters and needs about 1 GB of VRAM on a GPU; larger models need more.
  • The first run downloads the model, so it needs the internet; later runs reuse the cached model.
  • Whisper writes several output formats by default; use –output_format txt if you only want plain text.

Sources

See all