# UseSpeechRecognitionOptions (@salmonui/inputs/speech-to-text)

> The UseSpeechRecognitionOptions interface of @salmonui/inputs/speech-to-text.

Canonical: https://salmonui.dev/docs/reference/inputs/speech-to-text/UseSpeechRecognitionOptions

```ts
import type { UseSpeechRecognitionOptions } from '@salmonui/inputs/speech-to-text';
```

Entry index: https://salmonui.dev/docs/reference/inputs/speech-to-text (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/inputs/speech-to-text.md).

## Reference

Kind: interface

```ts
interface UseSpeechRecognitionOptions {
    readonly lang?: string | undefined;
    readonly interimResults?: boolean | undefined;
    readonly continuous?: boolean | undefined;
    readonly recognizer?: (() => SpeechRecognizer) | undefined;
    readonly onTranscriptChange?: ((transcript: string, details: SpeechTranscriptDetails) => void) | undefined;
    readonly onStart?: (() => void) | undefined;
    readonly onStop?: (() => void) | undefined;
    readonly onError?: ((error: SpeechRecognitionError) => void) | undefined;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `lang` | `readonly lang?: string \| undefined;` | optional | BCP 47 recognition language. Default: `document.documentElement.lang`, read when a session starts. |
| `interimResults` | `readonly interimResults?: boolean \| undefined;` | optional | Deliver interim (non-final) results. Default `true`. |
| `continuous` | `readonly continuous?: boolean \| undefined;` | optional | Keep listening after a pause until `stop()`. Default `true`. |
| `recognizer` | `readonly recognizer?: (() => SpeechRecognizer) \| undefined;` | optional | Replaces the browser recognizer, e.g. a cloud service. Called once per session. |
| `onTranscriptChange` | `readonly onTranscriptChange?: ((transcript: string, details: SpeechTranscriptDetails) => void) \| undefined;` | optional | The session transcript changed. |
| `onStart` | `readonly onStart?: (() => void) \| undefined;` | optional | The recognizer started capturing audio. |
| `onStop` | `readonly onStop?: (() => void) \| undefined;` | optional | The session ended (`stop()`, `abort()`, an error or the recognizer). |
| `onError` | `readonly onError?: ((error: SpeechRecognitionError) => void) \| undefined;` | optional | A recognizer error, or `'unsupported'` when `start()` has no recognizer. |
