ValyroUI English version

Voice Input

Голосовой ввод с волной и расшифровкой. Pro · ИИ: чат и агенты › Голос

Установка

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';

Пропсы

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.

Похожие компоненты

  • Voice Orb — Анимированная сфера голосового режима
  • AI Chat Window — Окно AI-чата
  • Chat Message — Сообщения с потоковым выводом
  • Message Branches — Версии сообщения и дерево веток диалога
  • Streaming Text — Плавный вывод потока токенов
  • Markdown Preview — Отображение Markdown
  • Response Feedback — Оценка ответа и рубрика для асессоров
  • Prompt Composer — Поле промпта с вложениями
  • Inline Suggestion — Подсказка-автодополнение в поле ввода
  • Model Selector — Выбор модели ИИ
  • Model Comparison — Сравнение ответов нескольких моделей
  • Prompt Library — Библиотека промптов с переменными

Назад: Voice Orb · Далее: Token Usage · Весь раздел «ИИ: чат и агенты»