API reference: @salmonui/inputs/speech-to-text
SpeechRecognizerinterface
import type { SpeechRecognizer } from '@salmonui/inputs/speech-to-text';interface SpeechRecognizer {
lang: string;
continuous: boolean;
interimResults: boolean;
start(): void;
stop(): void;
abort(): void;
onstart: ((event: unknown) => void) | null;
onresult: ((event: SpeechRecognizerResultEvent) => void) | null;
onerror: ((event: {
readonly error: string;
readonly message?: string;
}) => void) | null;
onend: ((event: unknown) => void) | null;
}
The subset of the Web Speech SpeechRecognition interface the hook uses. A cloud recognizer implements it; one instance per session.
| Name | Signature | Description |
|---|---|---|
lang | lang: string; | |
continuous | continuous: boolean; | |
interimResults | interimResults: boolean; | |
start | start(): void; | |
stop | stop(): void; | |
abort | abort(): void; | |
onstart | onstart: ((event: unknown) => void) | null; | |
onresult | onresult: ((event: SpeechRecognizerResultEvent) => void) | null; | |
onerror | onerror: ((event: {
readonly error: string;
readonly message?: string;
}) => void) | null; | |
onend | onend: ((event: unknown) => void) | null; |