Skip to content
TARUN S / PORTFOLIOTAP OR PRESS ANY KEY TO SKIP

Developer

000

Whisper Speech-to-Text Transcription

TYPE
Speech-to-text tool
STACK
07 COMPONENTS
STATUS
SOURCE AVAILABLE
FEATURED
—

01 / OVERVIEW

A batch transcription pipeline that translates mixed Urdu/English audio into English text using OpenAI's Whisper model.

A lightweight Python tool built around OpenAI's Whisper for converting spoken audio into English text. It's designed for batch processing: point it at a folder of recordings and it walks through every file, running each one through Whisper's translation task with the source language set to Urdu so that mixed Urdu/English speech is normalised into English output. The project supports both CPU and GPU execution paths — the CPU path uses the 'small' model out of the box, while a GPU path (via CUDA) is set up for the larger 'medium' model when a compatible device like a Quadro T1000 is available. A separate diagnostic script verifies that PyTorch can see the GPU and confirms the device name before a full run, which helps avoid silently falling back to slow CPU inference. The README also documents a known quirk of the workflow: the first file processed after loading the model always takes noticeably longer due to one-time model initialisation and (if applicable) GPU warm-up, so timing comparisons across files should account for that.

02/ STACK & ARCHITECTURE

BACKEND

  • Python
  • OpenAI Whisper
  • PyTorch
  • CUDA
  • Librosa
  • SoundFile
  • NumPy

03 / WHAT WAS ACTUALLY HARD

  1. 01

    Batch folder transcription

    Automatically scans an audios folder and processes every supported file (.mp3, .wav, .opus, .m4a, .flac) in sequence, printing the translated text and per-file processing time for each.

  2. 02

    Urdu/English mixed-language translation

    Uses Whisper's built-in translate task with the source language explicitly set to Urdu, so code-mixed Urdu/English speech is converted into clean English output rather than transcribed verbatim in the original language.

  3. 03

    CPU and GPU execution paths

    Ships with a CPU-first configuration using Whisper's 'small' model (with the FP16-on-CPU warning suppressed for cleaner logs), plus a commented-out GPU path that loads the larger 'medium' model onto CUDA when a suitable GPU is available.

  4. 04

    GPU diagnostic script

    A standalone pytorch_check.py script confirms CUDA availability and prints the detected device name (e.g. Quadro T1000), letting the setup be verified before committing to a full batch run.

  5. 05

    Documented setup and performance notes

    A README covers Python version constraints (3.7–3.10), virtual environment setup for Windows/macOS/Linux, required pip installs, and an explanation of why the first audio file in any run takes longer to process due to one-time model load overhead.