Pixeltable and Whisper: split long audio in Python

Learn to split audio at pauses in Pixeltable and compare local Whisper with hosted models, with segment sizing for OpenAI's stated 25MB limit.

Player not loading? Watch on YouTube

This Python tutorial uses Pixeltable to transcribe an earnings call lasting just over an hour. The speaker explains that cuts made mid-sentence can remove context and hurt recognition accuracy. Instead, an audio splitter iterator creates a view with one row per segment, using silence to choose boundaries.

The workflow exposes maximum segment size, minimum silence length, a silence threshold and optional leading-silence trimming. Each row includes start and end times and a position, plus references to the original recording and its metadata without copying the source. The speaker sizes segments around OpenAI's stated 25MB upload limit.

Separate computed columns apply local Whisper, OpenAI's hosted Whisper, WhisperX, Gemini and a Hugging Face ASR model to identical audio segments. Local Whisper runs offline without an API key, though the speaker notes CPU performance limits. The hosted options require keys. WhisperX adds optional speaker labels; the demonstrated diarization setup requires a Hugging Face token and acceptance of terms for two gated PyAnnote models.

The Gemini example also covers recovery from failed API calls: continue processing, retain error details and recompute only failed rows. Side-by-side queries reveal differences in names and wording. These examples help viewers compare outputs for their own recordings, but do not establish a universal accuracy winner.