Who it is forA developer building a meeting notes tool or voice feature who wants Whisper quality without the slowness.
The problemThe original Whisper package is slow and memory hungry, which makes it costly to run at any volume.
The outcomeA Python function that returns timestamped transcript segments and the detected language for any audio file.
What you need first
- Python 3.9 or greater
- No system FFmpeg needed: audio is decoded with PyAV
- For GPU: NVIDIA cuBLAS for CUDA 12 and cuDNN 9 for CUDA 12
Steps
- Run
pip install faster-whisper - Create a model with
WhisperModel(model_size, device="cuda", compute_type="float16"), or use device cpu with compute_type int8 if you have no GPU - Call
model.transcribe("audio.mp3", beam_size=5)to get segments and info - Iterate over the segments to print start, end and text; segments is a generator, so transcription only runs when you loop over it
- Read info.language and info.language_probability to see which language was detected
Prompt for your agent
Add SYSTRAN/faster-whisper to my Python project and write a function transcribe(path) that loads the <model size> model on <cuda or cpu with int8>, transcribes the file with beam_size=5 and returns a list of (start, end, text) plus the detected language. Test it on <audio file>.
Caveat. GPU use needs matching CUDA 12 and cuDNN 9 libraries; older CUDA setups need an older ctranslate2 version as the README explains.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for SYSTRAN/faster-whisper and "Add fast speech-to-text to a Python script"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer