# VoiceSelector

Choose a speech voice and preview samples.

- **Use it for**: Choosing a speech voice with samples.
- **Not for**: Choosing a model. Try [ModelSelector](https://unseenui.com/components/model-selector/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { VoiceSelector } from '@stackunseen/ui/media';
import '@stackunseen/ui/styles.css';

<VoiceSelector voices={voices} value={voice} onValueChange={setVoice} />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` |  |
| `label` | `string` |  |
| `labels` | `Partial<VoiceSelectorLabels>` | Replaces the built-in wording, for example to translate it. |
| `onPreview` | `((id: string) => void)` | Asks the host to play a short sample. |
| `onValueChange` (required) | `(id: string) => void` |  |
| `value` (required) | `string` |  |
| `voices` (required) | `readonly VoiceOption[]` |  |

## Keyboard

Tab reaches controls; Enter or Space activates buttons. Accordions use arrow keys, Home and End. Select menus support arrows and typeahead; Escape closes menus and dialogs and restores focus.

## Works with

[AudioPlayer](https://unseenui.com/components/audio-player/), [Transcription](https://unseenui.com/components/transcription/), [Persona](https://unseenui.com/components/persona/), [VoiceControl](https://unseenui.com/components/voice-control/)

Page: https://unseenui.com/components/voice-selector/
