Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Call Waveform

ProNew

Both 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

PropTypeDefault
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*number

The length of the call, in seconds.

—
currentTime*number

The playback position, in seconds.

—
onSeek*(seconds: number) => void—
markers{ at: number; label: string }[]

Moments worth marking, e.g. a transfer or an interruption.

[]
classNamestring—

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.