Models

Speech-to-text

openai/whisper-tiny-en

Model ID
openai/whisper-tiny-en
Type
Speech-to-text

Use this model

Transcribe audio in a web app

Install the browser SDK:

npm install @wfloat/wfloat-web

Load the model and pass a browser File, Blob, ArrayBuffer, or decoded audio buffer to transcribe:

import { loadSttModel } from "@wfloat/wfloat-web";
const stt = await loadSttModel("openai/whisper-tiny-en", {
language: "en",
onProgress(event) {
console.log(event.status);
},
});
const file = document.querySelector<HTMLInputElement>("#audio-file")?.files?.[0];
if (!file) throw new Error("Choose an audio file first.");
const result = await stt.transcribe({ audio: file });
console.log(result.text);

For microphone input, call await stt.startMicrophone(), then pass the value returned by await stt.stopMicrophone() to stt.transcribe(...).