Skip to main content

resampleTo16Khz()v4.0.518

Decodes an audio Blob, mixes it to mono, and resamples it to the 16kHz waveform expected by transcribe().

resample.ts
import {resampleTo16Khz} from '@remotion/whisper-webgpu'; const file = new File([], 'audio.wav'); const waveform = await resampleTo16Khz({ file, onProgress: (progress) => console.log(progress), }); console.log(waveform);

Options

file

An audio Blob or File supported by the browser's Web Audio decoder.

onProgress?

Called with values between 0 and 1 while the file is read, decoded, and resampled.

Compatibility

BrowsersEnvironments
Chrome
Firefox
Safari

See also