resampleTo16Khz()v4.0.518
Decodes an audio Blob, mixes it to mono, and resamples it to the 16kHz waveform expected by transcribe().
resample.tsimport {resampleTo16Khz } from '@remotion/whisper-webgpu'; constfile = newFile ([], 'audio.wav'); constwaveform = awaitresampleTo16Khz ({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
| Browsers | Environments | |||||
|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | ||||