Call Waveform
ProNewBoth sides of a call on one timeline, agent above the line and caller below, with markers for moments such as a transfer. Press, drag or use the keyboard to seek.
Installation
pnpm dlx shadcn@latest add @viewport/call-waveform
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| agent* | number[]Loudness of the agent's channel over the call, as numbers from 0 to 1. One value per slice of time. | — |
| caller* | number[]Loudness of the caller's channel, the same length as `agent`. | — |
| duration* | numberThe length of the call, in seconds. | — |
| currentTime* | numberThe playback position, in seconds. | — |
| onSeek* | (seconds: number) => void | — |
| markers | { at: number; label: string }[]Moments worth marking, e.g. a transfer or an interruption. | [] |
| className | string | — |
Accessibility
- A slider with the position read as minutes and seconds.
- Arrow keys move five seconds, Page Up and Page Down fifteen, Home and End to the ends.
- Markers are also listed as buttons under the waveform.
- Seeking clips the played part instead of redrawing the bars.