# AudioPlayer

A compact player for generated or recorded audio.

- **Use it for**: Playing generated or recorded audio.
- **Not for**: Live capture. Try [VoiceControl](https://unseenui.com/components/voice-control/).

## Installation

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

## Usage

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

<AudioPlayer src={audioUrl} label="Answer audio" />
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `className` | `string` |  |
| `label` (required) | `string` | Accessible name, for example the message or file it belongs to. |
| `src` (required) | `string` | Host-supplied audio URL (http(s), blob: or data:audio). |

## 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

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

Page: https://unseenui.com/components/audio-player/
