Skip to main content
Convert text to natural speech on smart glasses using session.audio.speak(). Powered by ElevenLabs TTS for high-quality voice synthesis.

Basic Usage

How It Works

  1. Your app calls session.audio.speak(text)
  2. MentraOS Cloud generates audio using ElevenLabs TTS
  3. Audio streams to the user’s device
  4. 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

Short messages are easier to understand:
Don’t overlap audio:
Combine audio with visual cues:
Not all devices have displays:

Voice Selection

Finding Voice IDs:
  1. Visit ElevenLabs Voice Library
  2. Choose a voice
  3. Copy the voice ID
  4. Use in your app
Configure default voice ID in your environment variables: ELEVENLABS_DEFAULT_VOICE_ID

Troubleshooting

Audio Not Playing

Check device capabilities:

TTS Timing Out

TTS has 60 second timeout:

Voice Quality Issues

Adjust voice settings:

Performance Tips

Pre-generate audio for frequently used phrases:
Faster speed = less time = better UX:

Return Value

The speak() method returns a promise that resolves with:
Example:

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