ValyroUI Русская версия

Voice Input

Voice input with waveform and transcript. Pro · AI chat and agents › Voice

Microphone button with a live waveform, for dictating into a composer. Toggle and push-to-talk modes, a transcript slot, Send / Cancel, and a clear blocked-microphone state with retry.

Installation

npx valyro-cli@latest login
npx valyro-cli@latest add voice-input
npm install valyro-ui-pro

import 'valyro-ui-pro/styles.css';
import { VoiceInput } from 'valyro-ui-pro';

Props

PropTypeDefault
mode'toggle' | 'push-to-talk''toggle'toggle: click to start, Send / Cancel to finish. push-to-talk: hold the button (or Space) and release to send.
recordingbooleanControlled recording; use with onRecordingChange.
defaultRecordingbooleanfalseInitial recording when uncontrolled.
onRecordingChange(recording: boolean) => voidCalled with the new recording when it changes.
microphonebooleantrueAsk for the microphone when recording starts and meter it. Turn off to feed level yourself — from your own audio pipeline, or simulated as in a demo.
levelAudioLevelInput level, 0–1, when microphone is off; a function is polled every frame.
onStream(stream: MediaStream | null) => voidReceives the microphone stream once granted (e.g. for a speech recognizer), and null when it stops.
transcriptReactNodeLive transcript shown above the bar; set it from your speech-to-text results.
onSend() => voidFinish and send: Send in toggle mode, releasing the button in push-to-talk.
onCancel() => voidThrow the recording away: Cancel, or Escape.
permission'unknown' | 'granted' | 'denied' | 'unsupported'Controlled permission; use with onPermissionChange.
defaultPermission'unknown' | 'granted' | 'denied' | 'unsupported''unknown'Initial permission when uncontrolled.
onPermissionChange(permission: VoicePermission) => voidCalled with the new permission when it changes.
onError(error: unknown) => voidA getUserMedia failure (denied, no device, in use).
disabledbooleanfalseDisables the mic and Retry buttons, so recording can't start.
barsnumber32Number of waveform bars.
localestringBCP 47 locale for the timer digits; defaults to the ThemeProvider's.
labelsPartial<VoiceInputLabels>Overrides for the built-in English text; keys left out keep their defaults.

Related components

Previous: Voice Orb · Next: Token Usage · All AI chat and agents