Learn how to play audio from URLs, synthesize speech with ElevenLabs, and manage playback in MentraOS apps.
2.1.2
installed in your projectsrc/index.ts
.
Option | Type | Default | Description |
---|---|---|---|
voice_id | string | Server default | ElevenLabs voice ID |
model_id | string | eleven_flash_v2_5 | TTS model to use (see models below) |
voice_settings.stability | number | 0.5 | Voice stability and randomness (0.0-1.0) . Lower values introduce broader emotional range, higher values can result in monotonous voice |
voice_settings.similarity_boost | number | 0.75 | How closely AI adheres to original voice (0.0-1.0) |
voice_settings.style | number | 0.0 | Style exaggeration of the voice (0.0-1.0) . Amplifies original speaker’s style but increases latency |
voice_settings.use_speaker_boost | boolean | false | Boosts similarity to original speaker. Increases computational load and latency |
voice_settings.speed | number | 1.0 | Playback speed. 1.0 = normal, <1.0 = slower, >1.0 = faster |
Model | Description | Languages | Latency |
---|---|---|---|
eleven_v3 | Human-like and expressive speech generation | 70+ languages | Standard |
eleven_flash_v2_5 | Ultra-fast model optimized for real-time use | All multilingual_v2 languages + hu, no, vi | ~75ms |
eleven_flash_v2 | Ultra-fast model (English only) | en | ~75ms |
eleven_turbo_v2_5 | High quality, low-latency with good balance | Same as flash_v2_5 | ~250-300ms |
eleven_turbo_v2 | High quality, low-latency (English only) | en | ~250-300ms |
eleven_multilingual_v2 | Most lifelike with rich emotional expression | en, ja, zh, de, hi, fr, ko, pt, it, es, id, nl, tr, fil, pl, sv, bg, ro, ar, cs, el, fi, hr, ms, sk, da, ta, uk, ru | Standard |