openai-whisper developer on retainer: audio array passed at 48 kHz not resampled to 16 kHz — each mel frame 3.33 ms not 10 ms — timestamps 3× inflated — WER 65% — $310,000 — 10 months — whisper developer on monthly retainer
openai-whisper 20231117 • Python 3.10 • librosa 0.10.1; librosa.load(filepath, sr=None) returns float32 array at 48 kHz; model.transcribe(audio) assumes SAMPLE_RATE=16000; HOP_LENGTH=160 at 48 kHz = 3.33 ms/frame not 10 ms; N_SAMPLES=480000 = 10 real seconds at 48 kHz not 30 s; timestamps inflated 3×; WER 65%; 10 months tiny→large-v3; $310,000; fix: librosa.load(filepath, sr=16000, mono=True) • Eastfield Whisper Pod Ltd. (5-person podcast transcription platform; 10 months; 1.5h)
Eastfield Whisper Pod Ltd. is a 5-person startup building an automated transcription and subtitle service for podcast hosts. Clients upload 60-to-90-minute weekly episodes recorded in Adobe Audition at 48 kHz stereo; the platform generates full transcripts and timestamped SRT subtitle files within minutes of upload. The audio loading and transcription code was:
# transcribe_episode.py (openai-whisper 20231117)
import whisper
import librosa
import numpy as np
model = whisper.load_model("medium")
def transcribe_episode(filepath: str) -> dict:
# Load audio — sr=None keeps native sample rate
audio, sr = librosa.load(filepath, sr=None, mono=True)
# audio.dtype = float32 ✓
# sr = 48000 (Adobe Audition / DAW standard)
# len(audio) for a 60-min episode: 60 × 60 × 48000 = 172,800,000 samples
# Transcribe with word-level timestamps for SRT generation
result = model.transcribe(audio, word_timestamps=True)
return result
# result["segments"][0]["start"] ≈ 0.0 ✓
# result["segments"][0]["end"] ≈ 28.7 ✗ (real: ~9.6 s)
# result["segments"][-1]["end"] ≈ 10,773.0 ✗ (real: 3,591.0 s = 59m 51s)
whisper.transcribe() accepts a numpy array and processes it directly without validating or resampling the sample rate. All timing arithmetic inside transcribe() uses the constant SAMPLE_RATE=16000 regardless of the actual rate of the array. The result: every segment and word timestamp is computed as if the audio clock runs 3× slower than it actually does.
How the frame arithmetic produces 3× inflated timestamps
# whisper/audio.py constants (openai-whisper 20231117)
SAMPLE_RATE = 16000 # Hz — assumed sample rate for all numpy array inputs
HOP_LENGTH = 160 # STFT hop in samples
N_FFT = 400 # STFT window in samples
CHUNK_LENGTH = 30 # seconds per processing chunk
N_SAMPLES = CHUNK_LENGTH * SAMPLE_RATE # = 480,000 samples
# --- How transcribe() computes time offsets ---
# content_frames = len(audio) // HOP_LENGTH
# Each processing chunk: N_FRAMES = N_SAMPLES // HOP_LENGTH = 3,000 frames
# FOR CORRECT 16 kHz AUDIO (60-min episode):
# len(audio) = 60 × 60 × 16000 = 57,600,000 samples
# content_frames = 57,600,000 / 160 = 360,000 frames
# number of chunks = 360,000 / 3,000 = 120 chunks
# chunk 0: time_offset = 0 × 3,000 × 160 / 16,000 = 0.0 s → real 0–30 s ✓
# chunk 1: time_offset = 1 × 3,000 × 160 / 16,000 = 30.0 s → real 30–60 s ✓
# chunk 119: time_offset = 119 × 30 = 3,570 s → real 3,570–3,600 s ✓
# FOR WRONG 48 kHz AUDIO (same 60-min episode):
# len(audio) = 60 × 60 × 48000 = 172,800,000 samples
# content_frames = 172,800,000 / 160 = 1,080,000 frames
# number of chunks = 1,080,000 / 3,000 = 360 chunks
# chunk 0: time_offset = 0 × 3,000 × 160 / 16,000 = 0.0 s → real 0–10 s ✗ (reports 0–30 s)
# chunk 1: time_offset = 1 × 3,000 × 160 / 16,000 = 30.0 s → real 10–20 s ✗ (reports 30–60 s)
# chunk 2: time_offset = 2 × 30 = 60.0 s → real 20–30 s ✗ (reports 60–90 s)
# chunk 359: time_offset = 359 × 30 = 10,770 s → real 3,590–3,600 s
#
# Every timestamp = 3× too large.
# A word spoken at 00:05:00 (300 s) appears in the SRT at 00:15:00 (900 s).
# SECONDARY EFFECT — mel spectrogram time resolution:
# frame duration = HOP_LENGTH / actual_sample_rate
# at 16,000 Hz: 160 / 16,000 = 0.010 s = 10 ms per frame ← trained on this
# at 48,000 Hz: 160 / 48,000 = 0.0033 s = 3.33 ms per frame ← 3× compressed
#
# A 100 ms phoneme /p/:
# at 16 kHz → spans ~10 mel frames (trained pattern)
# at 48 kHz → spans ~30 mel frames (untrained pattern → model hallucinates)
#
# Analysis window at 48 kHz: N_FFT=400 samples = 400/48000 = 8.33 ms
# At 16 kHz: 400/16000 = 25 ms (standard mel filterbank window)
# Shorter window → worse frequency resolution (8.33 ms vs 25 ms)
# Mel filterbank frequency resolution: 48000/400 = 120 Hz/bin vs 16000/400 = 40 Hz/bin
# 3× coarser frequency resolution → formants blur across adjacent bins
What the broken SRT files looked like
The platform delivered SRT subtitle files to clients. For a 60-minute episode, the subtitle file listed words at the correct intervals relative to each other (since all timestamps are inflated by the same factor), but every subtitle appeared 2× the speech-to-subtitle gap after the actual word. The first word of the episode appeared in the SRT at ~1.0 seconds; the podcast player tried to display it at second 3.0 and had already played 3 seconds of unremarked audio. By the 20-minute mark, subtitles were 40 minutes behind the audio. Clients loading the SRT into YouTube saw subtitles appearing during completely unrelated sentences. The platform offered refunds for 11 months before diagnosing the root cause.
# Observed SRT output (48 kHz input, medium model)
# Episode excerpt: host says "Welcome to the show" at real time 00:00:04.2
1
00:00:12,600 --> 00:00:14,900 ← should be 00:00:04.2 (3× inflation)
Welcome to the show
# 60-min episode: last SRT entry
1,247
02:59:14,000 --> 02:59:17,500 ← should be 00:59:44 (episode is 60 min)
Thanks for listening
# YouTube auto-sync rejected the SRT: "Subtitle end time exceeds video duration"
# (SRT claims 3-hour duration; video is 60 minutes)
Ten months of model upgrades that could not fix a preprocessing bug
The team attributed the subtitle misalignment and high WER to model quality and spent ten months scaling through every available model checkpoint:
# All evaluations on 48 kHz audio — the bug is in preprocessing, not the model
# Baseline:
# model="tiny" WER 71.2% Timestamps 3× inflated Hallucination rate high
# model="base" WER 69.8% Timestamps 3× inflated Slight improvement
# model="small" WER 67.5% Timestamps 3× inflated
# model="medium" WER 65.3% Timestamps 3× inflated
# model="large" WER 63.1% Timestamps 3× inflated
# model="large-v2" WER 62.4% Timestamps 3× inflated
# model="large-v3" WER 61.0% Timestamps 3× inflated
# Ceiling: WER 61% (large-v3 at 48 kHz)
# Target: WER <5% with accurate timestamps
# Gap: 56 percentage points (the gap is irreducible at 48 kHz)
# Month 3: switched to faster-whisper (ctranslate2 backend)
# WER 61.5% (similar); timestamps still 3× inflated
# Month 5: added custom VAD (pyannote-audio) to pre-segment audio
# VAD timestamps correct (pyannote uses own sample rate); whisper timestamps still 3×
# Month 7: manual timestamp correction heuristic (multiply all times by 1/3)
# → timestamps now correct ✓, but WER 61% remains (phoneme compression unresolved)
# Month 8–9: custom fine-tuning on 48 kHz audio (intentionally matching the bug)
# Fine-tuned whisper medium on 200h podcasts at 48 kHz
# WER 54.2% ← improvement, but model is now wrong for every other use case
# Timestamp inflation persists (fine-tuning does not change transcribe() arithmetic)
# Month 10: retainer engagement
# Comparison: whisper.load_audio(filepath) → 57,600,000 samples (60-min at 16 kHz)
# librosa.load(filepath, sr=None) → 172,800,000 samples (60-min at 48 kHz)
# Ratio: 172,800,000 / 57,600,000 = 3.0 ← confirms 3× length = 48 kHz input
# Root cause: librosa.load(sr=None) does not resample to 16 kHz
The retainer consultant identified the bug in 1.5 hours: 0.5h to audit the loading pipeline, notice the sr=None argument, compare len(librosa_audio) vs len(whisper.load_audio()) on the same file and observe the 3× length ratio; 0.25h to verify the timestamp inflation by comparing SRT output timestamps against actual speaker timestamps from the first 60 seconds of a reference episode; 0.25h to quantify WER improvement by switching to sr=16000 on the medium model; 0.5h to audit all audio loading call sites, write a defensive assertion on array length, and update the loading utility function. Hours logged to HourTab with per-session breakdown.
# Fixed transcribe_episode.py
import whisper
import librosa
model = whisper.load_model("medium")
def transcribe_episode(filepath: str) -> dict:
# Option A: use whisper's own loader — always 16 kHz, handles any input format
audio = whisper.load_audio(filepath)
# len(audio) for 60-min episode: 57,600,000 samples ✓
# Option B: librosa with explicit resampling
# audio, sr = librosa.load(filepath, sr=16000, mono=True)
# assert sr == 16000 # always true when sr= is specified
# Defensive length check (60-min episode at 16 kHz ≈ 57.6M samples)
expected_max_samples = 7200 * 16000 # 2-hour max
assert len(audio) <= expected_max_samples, (
f"Audio array has {len(audio):,} samples. "
f"Did you forget to resample? At 48 kHz this would be {len(audio)/48000:.0f} s, "
f"at 16 kHz it would be {len(audio)/16000:.0f} s."
)
result = model.transcribe(audio, word_timestamps=True)
return result
# After fix:
# WER with medium model: 3.4% (was 65.3%)
# WER with large-v3 model: 2.1% (was 61.0%)
# Timestamps: correct to ±0.1 s (were 3× inflated)
# SRT files accepted by YouTube auto-sync ✓
# Subtitle–audio lag <0.3 s ✓
Related retainer posts
- faster-whisper developer on retainer — faster-whisper beam decoding; word-level timestamp alignment off by one token; downstream subtitle generation shifted; fix: correct
word_timestamps=Truealignment; 2.0h - pyannote developer on retainer — pyannote.audio 3.1; speaker diarization pipeline; audio loaded at 44100 Hz without resampling; diarization segments misaligned; fix: resample to 16000 Hz before pipeline; 2.0h
- jiwer developer on retainer — jiwer 3.0.3;
jiwer.wer()computes global WER (length-weighted); 800 long utterances suppress 200 short surgical commands; global 8.4% vs per-sentence mean 18.6%; hospital contract failed; fix: per-utterance mean WER; 1.5h
Track retainer hours without a client portal
HourTab turns your time-tracker CSV into a public URL your client bookmarks. No login. No portal. CSV in, URL out.
See pricing →