use case · basics · multilingual token space & 30s Log-Mel window · WASM q8 · 40.85 MB

Inside Whisper-Tiny: Multilingual Token Space & 30s Mel Window

Multilingual Whisper switches behaviour through special prefix tokens: <|startoftranscript|> → <|lang|> → <|transcribe|> or <|translate|> → optional <|notimestamps|>. Compare live transcription vs speech-to-English translation on real audio, then benchmark 2 s–11 s slices across the fixed 30 s Log-Mel encoder window.

1 · Whisper-Tiny Multilingual worker (40.85 MB q8 WASM)

2 · Live <|transcribe|> vs <|translate|> & language-hint conditioning

Initialise Whisper-Tiny above to compare <|transcribe|> vs <|translate|> and inspect the 30s Mel window.

Loading clip…

Pass A · task: "transcribe" (<|transcribe|> id 50359)

Run comparison above to decode in native language.

–

Pass B · task: "translate" → English (<|translate|> id 50358)

Run comparison above to translate speech directly to English.

–

Step-0 <|lang|> detection softmax on active clip

Run comparison to inspect Whisper's 99-language softmax distribution.

3 · Fixed 30s Log-Mel window & 2s / 5s / 8s / 11s invariance sweep

Every slice is zero-padded to 30.0 s (480,000 samples → 3,000 mel frames × 80 bins) before the 4-layer encoder runs, so encoder work stays constant across clip lengths.

2s vs 11s latency–
Mean latency–
Min–max spread–
2s zero-pad waste–
NaN count–
Measured Whisper-Tiny latency, active frames, chunks, and transcript per sub-clip
Sub-clip Active frames / 3000 Zero-pad % Measured ms Detected lang Tokens Transcript
Run the 2s / 5s / 8s / 11s sweep above to inspect real per-slice timings.

4 · Inspect prefix token builder & 80-bin Log-Mel code

Show the code · whisper-tiny-core.mjs — buildWhisperPromptTokens() (SOT + <|lang|> + task + timestamps)
Show the code · whisper-tiny-core.mjs — computeLogMelPreview() (512-pt FFT + 80-bin Mel filterbank)