Library/AgentVoiceControl

AgentVoiceControl

Voice-input and text-to-speech widget for AI agents using Web Speech API.

Simple Build
Interactive Preview
Initialising Operative...

Architecture

Component Architecture
AgentVoiceControl/

Prop Usage

PropTypeDefaultDescription
onTranscript
(text: string) => voidCalled with the recognised speech text.
speakText
stringText to read aloud via TTS when provided.
lang
string"en-US"BCP-47 language tag for speech recognition.
className
stringAdditional classes.

Usage

import { AgentVoiceControl } from '@/ui/features/AgentVoiceControl'; const [reply, setReply] = useState(''); <AgentVoiceControl onTranscript={async (text) => { const res = await fetch('/api/chat', { body: JSON.stringify({ message: text }) }); const data = await res.json(); setReply(data.reply); }} speakText={reply} />