session.audio.speak(). Powered by ElevenLabs TTS for high-quality voice synthesis.
Basic Usage
How It Works
- Your app calls
session.audio.speak(text) - MentraOS Cloud generates audio using ElevenLabs TTS
- Audio streams to the user’s device
- Plays through glasses speakers or phone
Voice Customization
Custom Voice
Voice Settings
Volume Control
TTS Options
Voice Settings Options
Common Patterns
Voice Confirmation
Notifications
Multi-Step Instructions
Contextual Responses
Error Handling
Best Practices
Keep Messages Brief
Keep Messages Brief
Short messages are easier to understand:
Wait for Completion
Wait for Completion
Don’t overlap audio:
Provide Visual Feedback
Provide Visual Feedback
Combine audio with visual cues:
Handle Audio-Only Devices
Handle Audio-Only Devices
Not all devices have displays:
Voice Selection
Finding Voice IDs:- Visit ElevenLabs Voice Library
- Choose a voice
- Copy the voice ID
- Use in your app
Configure default voice ID in your environment variables:
ELEVENLABS_DEFAULT_VOICE_IDTroubleshooting
Audio Not Playing
Check device capabilities:TTS Timing Out
TTS has 60 second timeout:Voice Quality Issues
Adjust voice settings:Performance Tips
Cache Common Phrases
Cache Common Phrases
Pre-generate audio for frequently used phrases:
Use Appropriate Speed
Use Appropriate Speed
Faster speed = less time = better UX:
Return Value
Thespeak() method returns a promise that resolves with:
Next Steps
Playing Audio Files
Play pre-recorded audio from URLs
Speech-to-Text
Listen to user voice input
Audio Manager
Complete audio API reference
Device Control
All device control features

