packages/docs/docs/whisper-webgpu/can-use-whisper-webgpu.mdx
Asynchronously checks whether WebGPU can be used in the current browser. WebGPU, a usable adapter, and a secure context (or localhost) is required.
import {canUseWhisperWebGpu} from '@remotion/whisper-webgpu';
const result = await canUseWhisperWebGpu();
if (!result.supported) {
throw new Error(result.detailedReason);
}
console.log(result.supported);
A Promise resolving to a CanUseWhisperWebGpuResult object with the following properties:
supportedboolean
true if WebGPU transcription is supported, false otherwise.
reason?If supported is false, a categorized reason why WebGPU transcription is not supported:
window-undefinedwebgpu-unavailablewebgpu-requires-secure-contextdetailedReason?If supported is false, a human-readable explanation of why WebGPU transcription is not supported.