← Journal
Speech recognition without the cloud: Running faster-whisper

Speech recognition without the cloud: Running faster-whisper

This article records a run of faster-whisper with network access disabled. CTranslate2 accelerates OpenAI's Whisper model, and the test exposed errors characteristic of synthesized audio despite successful transcription from synthetic speech.

Repository covered in this article

SYSTRAN/faster-whisper

Faster Whisper transcription with CTranslate2

24.3k Python MIT License

You may hesitate to send the audio from meeting recordings or customer-support calls to an external transcription API. faster-whisper is a library that runs OpenAI's Whisper speech-recognition model with CTranslate2 as its inference engine. I installed it and tested speech recognition with network access disabled.

The library speeds up Whisper and reduces memory use by leaving the model weights intact and replacing the inference layer with CTranslate2. The project releases its source code under the MIT License(*1).

1. Install it

I included the espeak-ng speech-synthesis command to make the test self-contained without an external audio file.

FROM docker.io/library/python:3.12.13-slim
RUN apt-get update && apt-get install -y --no-install-recommends espeak-ng && rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir --quiet 'faster-whisper==1.2.1'
COPY warmup_model.py /tmp/warmup_model.py
RUN python /tmp/warmup_model.py
WORKDIR /work
# warmup_model.py (fetches the model during the build)
from faster_whisper import WhisperModel

model = WhisperModel("tiny.en", device="cpu", compute_type="int8")
print("model loaded ok")
podman build -t faster-whisper-sandbox .

2. Synthesize speech and transcribe it

I generated an audio file with espeak-ng and passed it to faster-whisper. I blocked network access for the test.

import subprocess
from faster_whisper import WhisperModel

text = "Open source software lets anyone read, modify, and redistribute the code."
subprocess.run(["espeak-ng", "-w", "/work/sample.wav", text], check=True)

model = WhisperModel("tiny.en", device="cpu", compute_type="int8")
segments, info = model.transcribe("/work/sample.wav", beam_size=5)

print(f"DETECTED LANGUAGE: {info.language} (probability {info.language_probability:.2f})")
for segment in segments:
    print(f"  [{segment.start:.2f}s -> {segment.end:.2f}s] {segment.text}")
podman run --rm --network none --memory 2g --cpus 2 --pids-limit 512 \
  -v "$(pwd)":/work -w /work faster-whisper-sandbox \
  python transcribe_demo.py

-v makes the specified directory readable and writable from inside the container. Use a dedicated empty directory for the experiment.

The command produced this output.

SOURCE TEXT (spoken via espeak-ng): Open source software lets anyone read, modify, and redistribute the code.
DETECTED LANGUAGE: en (probability 1.00)
TRANSCRIPT:
  [0.00s -> 5.00s]  Open source software, let's send it one read, modify and redistribute the code.

The model identified the language as English with 1.00 confidence and transcribed most of the sentence. It misrecognized “lets anyone” as “let's send it one.” The mechanical pronunciation of the synthetic audio generated by espeak-ng is a plausible cause of the error. Natural human speech should produce fewer errors. This result reflects the quirks of synthetic speech as an input condition and does not establish a limit of the recognizer's accuracy. For production use, test with human voices. If needed, use a model larger than tiny.en and check its accuracy.

Turn speech into text without sending it to the cloud

The ability to transcribe audio without sending it outside your environment affects the design of workflows that handle recordings. Testing a small model confirmed that speech recognition works without network access. You gain another option for workflows that require extra care with voice data.

Sources

*1 faster-whisper (GitHub), https://github.com/SYSTRAN/faster-whisper, MIT License