This is how I added an in-browser auto captions feature to my YouTube Shorts converter web application using Whisper AI and ffmpeg.wasm A developer added an in-browser auto captions feature to Convert to Shorts, a browser-based tool that converts horizontal videos to YouTube Shorts format, using Whisper AI and ffmpeg.wasm. The feature runs entirely client-side to preserve privacy, extracting audio via the Web Audio API, transcribing with Transformers.js, and burning captions using ASS subtitles after drawtext filters proved unreliable. A few weeks ago I launched Convert to Shorts — a free browser-based tool that converts horizontal videos to YouTube Shorts format 9:16 without uploading anything to a server. I wrote about the ffmpeg.wasm + Vite setup in a previous article. The most requested feature after launch was auto captions. Captions significantly boost Shorts engagement since most people watch without sound, and manually typing captions is tedious. The challenge: how do you add free auto captions to a privacy-first tool that never uploads your video to a server? The answer: run Whisper AI in the browser. The stack - @xenova/transformers — Hugging Face's JavaScript port of the Transformers library, runs ONNX models in the browser via WebAssembly Step 1: Audio extraction Whisper expects mono 16kHz audio as a Float32Array. The Web Audio API handles this cleanly: async function extractAudio file: File, trimStart: number, trimEnd: number : Promise