| name | voice |
| description | Voice recognition, wake words, and voice-controlled trading |
| emoji | 🎤 |
| gates | {"envs":{"anyOf":["OPENAI_API_KEY","WHISPER_MODEL_PATH"]}} |
Voice - Complete API Reference
Voice-controlled interface with wake word detection, speech-to-text, and text-to-speech.
Chat Commands
Voice Control
/voice start Start voice listening
/voice stop Stop voice listening
/voice status Check voice status
/voice wake "hey clodds" Set wake word
Settings
/voice language en-US Set language
/voice sensitivity high Wake word sensitivity
/voice timeout 30 Silence timeout (seconds)
/voice continuous on Enable continuous mode
TypeScript API Reference
Create Voice Assistant
import { createVoiceAssistant } from 'clodds/voice';
const voice = createVoiceAssistant({
wakeWord: 'hey clodds',
wakeWordSensitivity: 0.5,
stt: {
provider: 'whisper',
model: 'base',
language: 'en',
},
tts: {
provider: 'elevenlabs',
voice: 'rachel',
speed: 1.0,
},
silenceTimeoutMs: 3000,
maxRecordingMs: 30000,
});
Start/Stop Listening
await voice.start();
const isListening = voice.isListening();
await voice.stop();
Event Handlers
voice.on('wake', () => {
console.log('Wake word detected!');
});
voice.on('speech', (text: string) => {
console.log(`User said: ${text}`);
});
voice.on('transcript', (result) => {
console.log(`Final: ${result.text}`);
console.log(`Confidence: ${result.confidence}`);
console.log(`Duration: ${result.durationMs}ms`);
});
voice.on('error', (error) => {
console.error('Voice error:', error);
});
voice.on('silence', () => {
console.log('User stopped speaking');
});
Speak (TTS)
await voice.speak('Your order has been placed');
await voice.speak('Market is up 5%', {
voice: 'josh',
speed: 1.2,
pitch: 1.0,
});
voice.cancelSpeech();
Manual Transcription
const result = await voice.transcribe(audioBuffer, {
language: 'en',
prompt: 'Trading commands',
});
console.log(`Text: ${result.text}`);
console.log(`Language: ${result.language}`);
Voice Activity Detection
const vad = voice.getVAD();
vad.on('speechStart', () => {
console.log('User started speaking');
});
vad.on('speechEnd', (audio) => {
console.log('User stopped speaking');
});
Wake Word Configuration
| Setting | Values | Description |
|---|
wakeWord | Any phrase | Trigger phrase |
sensitivity | 0.0 - 1.0 | Detection threshold |
Built-in wake words:
- "hey clodds"
- "okay clodds"
- "clodds"
STT Providers
| Provider | Quality | Speed | Offline |
|---|
| Whisper | Excellent | Medium | Yes |
| Vosk | Good | Fast | Yes |
| Google | Excellent | Fast | No |
TTS Providers
| Provider | Quality | Voices | API Key |
|---|
| ElevenLabs | Premium | 30+ | Required |
| say (macOS) | Good | System | None |
| espeak | Basic | Many | None |
Voice Commands Examples
Once voice is active, speak naturally:
"Hey Clodds, what's my portfolio value?"
"Hey Clodds, buy 100 dollars of Trump YES"
"Hey Clodds, what are the top arbitrage opportunities?"
"Hey Clodds, set a price alert for Bitcoin at 100k"
Best Practices
- Quiet environment — Background noise affects accuracy
- Clear speech — Speak clearly for best recognition
- Short commands — Keep voice commands concise
- Confirmation — Enable confirmations for trades
- Fallback — Text input always available