Browser ASR utilities that detect support, create recognizers, and transcribe audio, with typed interfaces and error handling.
// Source: https://github.com/HBAI-Ltd/Toonflow-app | License: MIT | Copyright 2026 HBAI-Ltd
// Provided via justclaw.it.com; keep this notice with the code.
export type BrowserAsrState = "idle" | "starting" | "listening" | "stopping" | "destroyed";
export interface BrowserAsrResult {
text: string;
finalText: string;
interimText: string;
}
export interface BrowserAsrError {
code: string;
message: string;
}
export interface BrowserAsrOptions {
lang?: string;
continuous?: boolean;
interimResults?: boolean;
onStateChange?: (state: BrowserAsrState) => void;
onResult?: (result: BrowserAsrResult) => void;
onError?: (error: BrowserAsrError) => void;
}
export type BrowserAudioAsrOptions = {
lang?: string;
signal?: AbortSignal;
};
interface BrowserRecognition {
lang
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key