VoiceRecorder

Record, review, send. Recording scrolls a live waveform in from the right; review squeezes the take into the row and a playhead sweeps it. AI.

Open playground
00:00
Click to speak

About

VoiceRecorder is a React component in the AI category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { VoiceRecorder } from "@ashutoshswamy/smoui" and set level, bars, onStart among its 6 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { VoiceRecorder } from "@ashutoshswamy/smoui";

<VoiceRecorder level={micLevel} onSend={(seconds) => upload(seconds)} onDiscard={reset} />

Props 6

level

0-1 live input level. Without it the waveform plays a made-up voice.

number
bars

Bar count. Default 36.

number
onStart

Recording began.

() => void
onStop

Recording stopped; the take is in review.

(seconds: number) => void
onSend

The reviewed take was sent.

(seconds: number) => void
onDiscard

The take was thrown away.

() => void