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';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
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. |
recording | boolean | Controlled recording; use with onRecordingChange. | |
defaultRecording | boolean | false | Initial recording when uncontrolled. |
onRecordingChange | (recording: boolean) => void | Called with the new recording when it changes. | |
microphone | boolean | true | Ask 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. |
level | AudioLevel | Input level, 0–1, when microphone is off; a function is polled every frame. | |
onStream | (stream: MediaStream | null) => void | Receives the microphone stream once granted (e.g. for a speech recognizer), and null when it stops. | |
transcript | ReactNode | Live transcript shown above the bar; set it from your speech-to-text results. | |
onSend | () => void | Finish and send: Send in toggle mode, releasing the button in push-to-talk. | |
onCancel | () => void | Throw 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) => void | Called with the new permission when it changes. | |
onError | (error: unknown) => void | A getUserMedia failure (denied, no device, in use). | |
disabled | boolean | false | Disables the mic and Retry buttons, so recording can't start. |
bars | number | 32 | Number of waveform bars. |
locale | string | BCP 47 locale for the timer digits; defaults to the ThemeProvider's. | |
labels | Partial<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 · Весь раздел «ИИ: чат и агенты»