toCaptions()v4.0.518
Converts transcribe() output into Caption objects from @remotion/captions.
captions.tsimport {toCaptions ,transcribe } from '@remotion/whisper-webgpu'; constchannelWaveform = newFloat32Array (16_000); consttranscription = awaittranscribe ({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
| Browsers | Servers | Environments | |||||||
|---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | Node.js | Bun | Serverless Functions | ||||