Onex
Onex
Home
Products
Documentation
Changelog
Login with FiveM
  • 👋 Welcome
  • Claim Purchase
  • Translations
    • Weaponmeta
    • Voice Interaction
      Integrations
      Installation
      ⭐ Convars
      Llm-setup
      Stt-setup
      Configuration
      Features
      Api
Artifacts Tracker
  1. Onex Scripts
  2. Scripts_guides / Tts Setup
Ctrl K

TTS SETUP#

TTS (Text-to-Speech) is how NPCs speak — banking tellers, shop vendors, hospital receptionists, and ambient pedestrians. The script uses the built-in Onex TTS by default at no cost. BYOK keys unlock premium voice providers with higher quality and more voice options.

Default: Onex TTS (No Key Required)#

Onex TTS is always active as the base provider. It requires no API key, no account, and no configuration. Every NPC voice in the default NPC config uses a voice name (e.g. "en-US-GuyNeural").

If no tts_api_key is set, all NPC speech goes through Onex TTS automatically.

Providers#

ElevenLabs produces the most natural-sounding NPC voices. Requires a paid ElevenLabs account.

Get an ElevenLabs API key#

Sign up at elevenlabs.io and copy your API key from the profile settings.

Add to server.cfg#

set tts_api_key "your_elevenlabs_api_key" set tts_provider "elevenlabs" ensure [onex]

Configure voice assignment mode#

In shared/config.lua, set how ElevenLabs voices are assigned to NPCs:

Config.ElevenLabs = { -- "preconfigured" — use pre-assigned voices from data/npc_voices_elevenlabs.json -- "llm_origin" — LLM picks a voice based on the NPC's inferred character/origin -- "llm_accent" — LLM picks a voice matching the server's target language/accent voiceMode = "preconfigured", }

"preconfigured" is recommended for most servers. "llm_origin" and "llm_accent" require an LLM key to be configured.

Non-Latin Language Voices#

When Config.ResponseLanguage is set to a non-Latin language (e.g. "hi", "ja", "ar"), the addon can automatically switch to a language-native Edge TTS voice instead of using the NPC's configured English voice.

Config.UseNativeVoice = true -- default: true

When true, the system picks an appropriate native voice for the language (e.g. hi-IN-MadhurNeural for Hindi). Set to false to always use the NPC's configured voice with romanized text instead.

Has no effect when using ElevenLabs or Azure TTS.

Last updated 3 months ago

Quick Links

All DocumentationOur Products