useSpeechInput
View as Markdownfunction useSpeechInput(o): object;Defined in: react/src/speech.ts:38
Dictation via the browser’s Web Speech API (interimResults, continuous). onText receives
interim text (final: false, replaced by later interim/final text) and final text (final: true).
error is the recognizer’s error code (e.g. not-allowed, no-speech, network). Recognition
is aborted on unmount. supported is false during SSR and without the API.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
o |
{ lang: string; onText(text, final): void; } |
o.lang |
string |
o.onText |
(text, final) => void |
Returns
Section titled “Returns”object
| Name | Type | Defined in |
|---|---|---|
error? |
string |
react/src/speech.ts:43 |
listening |
boolean |
react/src/speech.ts:40 |
supported |
boolean |
react/src/speech.ts:39 |
start() |
() => void |
react/src/speech.ts:41 |
stop() |
() => void |
react/src/speech.ts:42 |