Speech and Vision Tasks in the Browser

Speech and Vision Tasks in the Browser

Microphone and camera streams make a strong privacy case for on-device AI. This covers the transcription and image pipelines that make it work in practice.

Microphone and camera streams make a stronger case for on-device inference than the text tasks in this topic — the content is ambient personal data, not something the user typed and expected to send anywhere. As of November 2026, transcription and image tasks ship on browser-runnable models, but the real engineering is the media pipeline around the model call, not the call itself, and the feasibility bar is genuinely higher than for text.

Why media tasks make a stronger on-device case

Every other task shape within this topic processes content the user actively created — a draft, a search query, a document. Microphone and camera streams are different. They are ambient: captured continuously, often before the user has decided whether anything in the frame or the recording matters. Sending that stream to a server by default is not a feature decision so much as a surveillance decision that happened to ship as a feature. Processing it on the device is the difference between the two.

There is a bandwidth asymmetry underneath the privacy one. Audio and image payloads are heavy compared to the short text strings that text-based client-side AI features handle, and shipping them to a server on every use adds up in a way a cached model download does not. The model is downloaded once and then kept in browser storage (Transformers.js caches models with the Cache API by default where it is available), though the browser can evict that storage when space runs low and the user can clear it; the stream savings recur every session the feature is used.

None of this makes media tasks easy. They are, honestly, a harder task shape than the text tasks this topic covers. Speech and vision models are not the largest models that run in a browser, but real-time constraints are stricter than for a batch text task such as summarization — a summarization feature that takes two extra seconds is mildly annoying, while a live transcription feature that lags two seconds behind speech is broken. This article's feasibility bar is higher than the rest of this topic's, and that is worth stating plainly before the market-reality survey below.

Consider the two feature shapes side by side. A text-summarization feature can accept a short user-perceived delay because the input is already sitting there, static, waiting to be processed once. A live captioning feature has no such grace period — every second of unprocessed audio is a second of accumulating backlog, and the user's tolerance for lag is measured against how fast they are actually speaking, not against an abstract latency budget someone wrote down in a design document. That difference in kind, not just degree, is why this article treats media tasks as a distinct category rather than a text task with a different input format.

Transcription in the page

Browser-runnable speech-to-text has become a real category rather than a research demo. As of November 2026, Whisper-family models run in the browser through the runtimes this topic has already introduced, at sizes small enough to ship as a downloadable asset. In the browser, Transformers.js runs a model on the CPU via WebAssembly by default, and on the GPU via WebGPU when the page sets device: 'webgpu' (Transformers.js documentation) — which also needs a browser that supports WebGPU, a feature web-features did not list as Baseline as of November 2026. These statements are a market-reality snapshot, not an endorsement of any one runtime or model — small-model releases move fast.

The part that takes the engineering effort is not the model call. A transcription feature is, structurally, three pieces of plumbing — capture, resample-and-chunk, and stitch — wrapped around one function invocation:

typescript
// Sketch: resampleAndChunk, transcriber and stitchTranscript are hypothetical helpers. The model call is one line; the rest is plumbing.
const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
const chunks = resampleAndChunk(stream, { targetRate: 16000, overlapMs: 200 })
for await (const chunk of chunks) {
  const partial = await transcriber(chunk)
  stitchTranscript(partial)
}

Capture through getUserMedia (MDN), which is available only in secure contexts such as HTTPS pages; resampling the microphone's native sample rate down to whatever the model expects and chunking the stream with enough overlap that a word is not cut in half across a chunk boundary; and stitching the resulting partial transcripts back into one coherent output — that is where a transcription feature's engineering time actually goes.

Real-time versus batch is the feasibility fork that decides what a given device can honestly offer. Transcribing a recording that has already finished is the more forgiving case: there is no latency budget to fight, and the model can take as long as it needs. Live transcription, where the user expects to see words appear as they speak, is device-tier dependent — capable on a recent flagship, degraded or absent on an older or lower-end device. The honest answer for a device that cannot keep up with live transcription is to degrade to batch: record, then transcribe, rather than pretending to keep pace and falling further behind with every sentence.

Language coverage is worth naming honestly too. A small speech model gives up some accuracy for its compact size — OpenAI's Whisper README describes its model sizes as speed and accuracy trade-offs, offers English-only versions of four of its six sizes, and notes that performance varies widely by language — so the shipped variant's actual language support is whatever its model card claims, cited, and evaluated on the specific languages the product serves rather than assumed from the model's headline description.

The stitching step deserves a closer look, because it is where subtle correctness bugs hide. Overlapping chunks exist specifically so a word spoken across a chunk boundary is not lost or duplicated, but overlap only helps if the stitching logic actually reconciles the overlapping region rather than naively concatenating chunk outputs end to end. A transcript that repeats a phrase or drops one entirely at a chunk seam can be a stitching bug rather than a model failure — the kind a test with deliberately awkward chunk boundaries is designed to catch.

Image tasks that ship today

As of November 2026, four image task shapes are supported by browser runtimes such as Transformers.js at browser-practical model sizes: background removal and segmentation, optical character recognition, classification and tagging, and short image captioning. These land in roughly the same tens-to-hundreds-of-megabyte band as the task models the rest of this topic has already covered.

The main argument this article makes for running these locally is not privacy this time — it is interaction feel. An image edit with instant local feedback (remove the background, re-frame, run it again if the first attempt is wrong) can beat a round-trip-per-attempt server loop on responsiveness, and avoids a billed call per attempt. A user iterating on a crop or a background removal ten times in a row is making ten local inferences instead of ten billed API calls.

Input normalization is the quiet failure source that looks, from the outside, exactly like a model problem. Canvas decode, resizing to the model's expected input dimensions, orientation correction, and color-space handling all happen before the model ever sees a pixel — get any of them wrong and the output degrades in ways a developer will spend an afternoon blaming the model for before finding the actual bug in the preprocessing step.

Generative image work — diffusion-class generation and heavy photo editing — is named here honestly as a likely poor fit for median hardware — a judgment, not a measured limit; as of November 2026, Transformers.js marks text-to-image as not supported. That line moves; it is stated as-of and worth revisiting rather than treated as a permanent boundary.

Background removal is worth a closer look as the clearest example of why the interaction-feel argument matters more than it first appears to. A server-side background-removal call involves an upload, server-side processing, and a download back — every one of those steps adds latency, and every retry after an imperfect result repeats the entire round trip. The local equivalent removes the network round trip, which can bring each retry closer to a preview and change the feature from "an effect you apply once and accept" into something closer to a live tool the user can nudge and re-run until it looks right. That qualitative shift in how a feature feels to use is easy to underweight when comparing raw model quality numbers side by side, but it can decide whether a feature gets used at all.

What this article adds to this topic's foundations

Everything the rest of this topic established about client-side AI still applies unchanged here. The model-selection shortlist, the capability ladder, the loading discipline, and the memory budgets are not being reinvented for media — this article adds the media pipeline and the real-time constraint on top of foundations that are already in place.

Worker placement matters more for media tasks than for most text tasks. Sustained audio processing or frame-rate-sensitive capture running on the main thread competes with rendering and input handling, so it can surface as dropped frames or delayed audio handling more readily than a one-off text-summarization call.

Permission UX is part of the feature itself, not an afterthought bolted onto it. If the user has not already granted or denied access, the browser can show a microphone or camera prompt before any model runs, and a user who denies that permission is not a broken edge case — it is a first-class rung on the feature's capability ladder. The feature explains what it needed the permission for and steps aside gracefully, rather than failing silently or nagging.

One boundary is worth stating plainly: the browser's own speech recognition API — SpeechRecognition in the Web Speech API, which web-features did not list as Baseline as of November 2026 — does not guarantee by default that audio stays on the device. Unless the page sets processLocally to true, the Web Speech API draft lets the browser choose remote processing, so speech data might be sent to a remote server (Web Speech API, W3C Community Group draft); on-device recognition also needs a language pack installed for the language being recognized (MDN). It is not a drop-in on-device route for this article's privacy argument. And general media capture and processing as web engineering, beyond preparing input for an inference call, sits outside what this topic covers.

Media tasks earn their place within this topic by being a harder case to get right than text — heavier inputs, tighter latency, and a pipeline that does most of the real work. Get the plumbing right, and the privacy and interaction wins are substantial.

Project Inquiry