# Voice Note

> Voice in a text thread.

Component · AI · Pro kit · [Live page](https://ui.twentyfirst.media/pro/components/VoiceNote/)

Voice in a text thread.

**VoiceNote**: a recorded voice message: play and pause, seek on the bars (a slider for keyboards and screen readers), the length, and the transcript behind "Show transcript". `src`, `duration` (seconds; read from the file if left out), `transcript`, `transcriptOpen` / `onTranscriptOpenChange`, `peaks` (loudness 0 to 1 for the bars), `mine` (the user's own, on the primary colour). `ChatMessage voice` uses it.

**VoiceLog**: after a voice conversation (`VoiceMode`), one folded record in the thread: `title` (default "Voice conversation"), `duration`, `time`, `turns` ({who, name, text}), `audio` (the recording, if it was kept), `open` / `defaultOpen` / `onOpenChange`.

## Example

```tsx
import { VoiceLog, VoiceNote } from "@twentyfirstmedia/pro";

export default function Preview() {
  return (
    <div className="tf-panel" style={{ gap: 16 }}>
      <VoiceNote
        duration={42}
        transcript="The renewal call went well. Ida wants the quote by Friday, with the PO number on it."
      />
      <div className="tf-row" style={{ justifyContent: "flex-end" }}>
        <VoiceNote mine duration={8} />
      </div>
      <VoiceLog
        defaultOpen
        duration="4:12"
        time="Yesterday 17:40"
        turns={[
          { who: "user", text: "What still needs me today?" },
          {
            who: "agent",
            name: "Atlas",
            text: "Two approvals: the Northwind reply and a refund of €10.",
          },
          { who: "user", text: "Approve the reply, I'll look at the refund later." },
          { who: "agent", name: "Atlas", text: "Sent. The refund stays in your inbox." },
        ]}
      />
    </div>
  );
}
```

## Props

### VoiceNote

| Prop | Type | Notes |
| --- | --- | --- |
| `src?` | `string` | The recording (any URL the browser can play). |
| `duration?` | `number` | Length in seconds (default: read from the file). |
| `transcript?` | `ReactNode` | The words, behind "Show transcript". |
| `transcriptOpen?` | `boolean` |  |
| `onTranscriptOpenChange?` | `(open: boolean) => void` |  |
| `peaks?` | `number[]` | Loudness per moment, 0 to 1, for the bars (default: a steady pattern). |
| `mine?` | `boolean` | Drawn as the user's own (on the primary colour). |
| `label?` | `string` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### VoiceLog

| Prop | Type | Notes |
| --- | --- | --- |
| `title?` | `string` | Default "Voice conversation". |
| `duration?` | `string` | Length as shown ("4:12"). |
| `time?` | `string` |  |
| `turns` | `VoiceTurn[]` | Required |
| `audio?` | `string` | The recording, if it was kept. |
| `audioDuration?` | `number` |  |
| `id?` | `string` |  |
| `open?` | `boolean` |  |
| `defaultOpen?` | `boolean` |  |
| `onOpenChange?` | `(open: boolean) => void` |  |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
