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.
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.
ElevenLabs produces the most natural-sounding NPC voices. Requires a paid ElevenLabs account.
Sign up at elevenlabs.io and copy your API key from the profile settings.
set tts_api_key "your_elevenlabs_api_key" set tts_provider "elevenlabs" ensure [onex]
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.
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 about 9 hours ago