Skip to main content

toCaptions()v4.0.518

Converts transcribe() output into Caption objects from @remotion/captions.

captions.ts
import {toCaptions, transcribe} from '@remotion/whisper-webgpu'; const channelWaveform = new Float32Array(16_000); const transcription = await transcribe({ channelWaveform, model: 'tiny.en', }); const {captions} = toCaptions({whisperWebGpuOutput: transcription}); console.log(captions);

startMs and endMs use the model's word boundaries. timestampMs is the midpoint of each word. confidence is null because Transformers.js does not expose calibrated word confidence values for this pipeline.

Options

whisperWebGpuOutput

A complete transcription or an array of timestamped words returned by transcribe().

Compatibility

BrowsersServersEnvironments
Chrome
Firefox
Safari
Node.js
Bun
Serverless Functions

See also