Transcribe audio locally with faster-whisper in Python

faster-whisper turns recordings such as meetings or dictations into text with a few lines of Python, running on your own hardware. Companies that do not want audio files to reach a cloud service can use it as a practical starting point.

Niklas Schult4 min read

Illustration: A horn speaker feeds out a paper strip, beside a wooden strongbox with a padlock, showing audio kept and transcribed locally.

What you will have at the end and what you need

At the end you will have a Python script that reads an audio file, detects the language and prints each segment with start and end times. It can also skip silent parts and list the time of every single word. The model runs on your own computer, so the recording stays on that machine.

You need Python 3.9 or greater. The documentation states that FFmpeg does not have to be installed on the system, because the Python library PyAV decodes the audio and bundles the FFmpeg libraries. A GPU is optional. GPU execution needs the NVIDIA libraries cuBLAS for CUDA 12 and cuDNN 9 for CUDA 12, while the CPU path in this tutorial needs neither.

Installation and first transcript

The project describes itself as a reimplementation of OpenAI's Whisper model on top of CTranslate2. According to the faster-whisper README, it is up to 4 times faster than openai/whisper at the same accuracy while using less memory. The package comes from PyPI, and the following command installs it.

Shell
pip install faster-whisper

The next script loads the large-v3 model on the CPU with INT8 quantization, transcribes audio.mp3 with a beam size of 5 and prints the detected language. It then prints every segment with its time range. When you load a model by its size, the matching CTranslate2 model is downloaded automatically from the Hugging Face Hub on first use, so plan for that single download.

Python
from faster_whisper import WhisperModel

model_size = "large-v3"

# Run on CPU with INT8 quantization
model = WhisperModel(model_size, device="cpu", compute_type="int8")

segments, info = model.transcribe("audio.mp3", beam_size=5)

print("Detected language '%s' with probability %f" % (info.language, info.language_probability))

for segment in segments:
    print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))

Filtering silence and printing word timings

The library integrates the Silero VAD model, which removes parts of the audio without speech. By default the filter is conservative and only cuts silence longer than 2 seconds. The call below switches the filter on and lowers the minimum silence duration to 500 milliseconds through the vad_parameters dictionary.

Python
segments, _ = model.transcribe(
    "audio.mp3",
    vad_filter=True,
    vad_parameters=dict(min_silence_duration_ms=500),
)

For subtitles or for jumping to a spot in a recording you may want the time of each word. Setting word_timestamps to True adds a list of words to every segment, and the loop below prints start, end and text for each of them.

Python
segments, _ = model.transcribe("audio.mp3", word_timestamps=True)

for segment in segments:
    for word in segment.words:
        print("[%.2fs -> %.2fs] %s" % (word.start, word.end, word.word))

How do I check that the transcription works?

Run the script on a short recording whose content you know. The first printed line should show the language you expect together with a probability, and the segment lines should follow the spoken text in order. If the language is wrong or the text is garbled, test a clearer recording before changing any settings.

The library uses standard Python logging. The snippet below sets the faster_whisper logger to DEBUG level, which shows more detail about what the library does while it runs.

Python
import logging

logging.basicConfig()
logging.getLogger("faster_whisper").setLevel(logging.DEBUG)

Typical pitfalls from the documentation

The README warns that segments is a generator. The transcription only starts when you iterate over it, so a script that never loops over the result appears to do nothing. Wrapping the result in list() runs the whole transcription at that point.

  • When comparing speed with other Whisper implementations, use the same beam size. openai/whisper defaults to 1, while faster-whisper defaults to 5.
  • On CPU, set the same number of threads for a fair comparison. The environment variable OMP_NUM_THREADS controls this for many frameworks.
  • The latest ctranslate2 versions support only CUDA 12 and cuDNN 9. For older CUDA setups the README names a downgrade of ctranslate2, to 3.24.0 for CUDA 11 with cuDNN 8 and to 4.4.0 for CUDA 12 with cuDNN 8.

The README adds that transcription speed depends strongly on the number of words in the transcript. A fair comparison therefore also checks that the other implementation reaches a similar word error rate. Without that check, a faster result may simply come from a shorter or less complete transcript.

Where this fits in a company

A script like this suits a single workstation or a small internal service. Once recordings contain personal data, for instance from works council meetings or client calls, the usual questions apply: who may upload files, how long transcripts are kept and who deletes them. Our overview of GDPR and AI at work lists the points companies commonly check. Someone in IT should own the Python environment, the model download and updates of the package.

Professions bound by secrecy under section 203 of the German Criminal Code can read how local AI keeps processing in their own network.

The README also lists community projects. One of them is speaches, an OpenAI-compatible server built on faster-whisper. It is useful if you want to offer transcription as an internal service. souveraen.ai offers an on-premise option and an OpenAI-compatible developer API for companies that want such building blocks inside a wider knowledge platform.

Sources

More articles

All articles

How safe are AI API routes via resellers and routers?

Security firm Dragos sent about two million requests with fake credentials to AI providers and found compromised services and resellers reading customer prompts. Companies that use AI through third parties need to know who sits on the path of their data.

Data protection4 min

Run Text Generation Inference with Docker on Your Server

Text Generation Inference (TGI) serves open language models from a single Docker container on your own hardware. This tutorial starts it, sends requests over HTTP and keeps prompts inside your network.

Tutorial4 min

Cloud outage liability: who answers when Microsoft fails

On 12 November 2026 a software fault took Exchange Online and Outlook offline for about 36 hours. A legal analysis published shortly afterwards argues that responsibility for such outages often lies with the operator rather than the provider.

Regulation4 min

Test it with your own documents.

Free for 3 days, then from €24.90 per user per month. Cancellable monthly.

Free for 3 days, then from €24.90 per user per month.Free for 3 days
Try free for 3 days