Core settings for onex-voiceInteraction are defined in shared/config.lua.
| Type | string |
| Default | "en" |
Sets the language for speech recognition. Use an ISO 639-1 code (e.g. "en", "fr", "de") to transcribe in that language, or "auto" to detect the player's spoken language automatically.
"auto" requires BYOK (your own API key) — it detects any spoken language and converts it to English before matching, so your English voice command setup works for all players. Without BYOK, "auto" falls back to "en".
Config.Language = "en"
| Type | string | nil |
| Default | nil |
Sets the language for NPC text-to-speech responses. Leave as nil to match Config.Language.
-- Speak Hindi, hear English responses Config.Language = "hi" Config.ResponseLanguage = "en"
| Type | string |
| Default | "native" |
| Values | "romanized" | "native" |
Controls which script is displayed in NPC speech subtitles when ResponseLanguage is a non-Latin language.
"native" — show native script (e.g. "آپ کیسے ہیں" for Urdu, "आप कैसे हैं" for Hindi)"romanized" — show romanized text matching TTS input (e.g. "aap kaise hain")Has no effect when the response language uses a Latin script.
Config.SubtitleScript = "native"
| Type | boolean |
| Default | true |
When ResponseLanguage is a non-Latin language, overrides the NPC's configured voice with a language-native Edge TTS model and sends native script text to the synthesizer. For example, ResponseLanguage = "hi" uses hi-IN-MadhurNeural (male) or hi-IN-SwaraNeural (female). Falls back to the NPC's configured voice if no native model is defined for the language.
Set to false to always use the NPC's configured voice with romanized text instead.
Config.UseNativeVoice = true
| Type | table |
Auto-translates player speech before command matching. Supports four modes depending on the combination of Config.Language and these settings:
| Mode | Config | Behavior |
|---|---|---|
| BYOK auto-detect | Language = "auto" | Whisper auto-detects and translates; Translate ignored |
| Fixed, no translate | Language = "hi", enabled = false | Match Hindi phrases directly |
| Fixed + translate, single-path | Language = "hi", enabled = true, dualMatch = false | Transcribe → Translate → match English only |
| Fixed + translate, dual-path | Language = "hi", enabled = true, dualMatch = true | Match both raw Hindi AND translated English, pick winner by priority |
Config.Translate = { enabled = false, -- Enable translation before matching targetLanguage = "en", -- Language to translate to dualMatch = false, -- Match raw AND translated text in parallel priority = "highest_score" -- "highest_score" | "raw_first" | "translated_first" }
| Type | string |
| Default | 'N' |
The key players hold to activate voice recognition. Must be a single uppercase letter or a valid FiveM key name.
Config.KeyBinding = 'N'
| Type | string |
| Default | 'X' |
The key players press to cancel NPC speech while it is playing.
Config.FeedbackCancelKey = 'X'
| Type | boolean |
| Default | false |
Prints detailed voice recognition and matching output to the F8 client console. Can also be enabled at runtime via the onex_voice_debug convar. Recommended to keep false in production.
Config.Debug = false -- or via convar: set onex_voice_debug "true"
| Type | boolean |
| Default | false |
Enables additional debug output from all addons (shops, ambient NPC, banking, etc.). Can also be enabled via the onex_voice_addondebug convar. Set false in production.
Config.AddonDebug = false -- or via convar: set onex_voice_addondebug "true"
| Type | boolean |
| Default | true |
Displays the recognized speech as text beneath the audio spectrum in the NUI. Color-coded by state: white while listening, yellow while processing, green on match, red on no-match.
Config.ShowTranscript = true
| Type | boolean |
| Default | false |
Enables a hidden voice command — say "voice recognition test" — that returns a confirmation response. Useful for verifying STT is working without triggering any addon actions.
Config.VoiceTestCommand = false
| Type | boolean |
| Default | false |
Master toggle for broadcasting NPC TTS speech to nearby players as positional audio. Each addon also has its own networkAudio toggle — both must be true for a given addon's audio to broadcast.
Config.NetworkAudio = { enabled = false, }
| Type | boolean |
| Default | false |
Enables a custom speech correction dictionary sent to the STT engine. Accepts up to 200 entries, each up to 50 characters.
Config.SpeechDictionaryEnabled = false
| Type | boolean |
| Default | false |
Sends vocabulary hint lists to the STT engine to improve recognition of domain-specific terms (e.g., item names, NPC commands).
| Type | number |
| Default | 50 |
Maximum number of vocabulary terms to include in the hint payload (global pool plus active layer terms combined).
Config.PromptHints = { enabled = false, maxTerms = 50, }
Each addon can be individually enabled or disabled. The full defaults from shared/config.lua:
Config.Addons = { npc_interact = { enabled = true, subtitles = true, networkAudio = true, }, shops = { enabled = true, subtitles = true, networkAudio = true, }, ambient_npc = { enabled = true, subtitles = false, networkAudio = false, }, self_expression = { enabled = true, }, npc_lift = { enabled = true, subtitles = false, networkAudio = false, }, npc_robbery = { enabled = true, subtitles = false, networkAudio = false, }, banking = { enabled = true, subtitles = true, networkAudio = true, }, hospital = { enabled = true, subtitles = true, networkAudio = true, }, }
Set an addon's enabled to false to fully disable it. Disabled addons do not load their config, proximity zones, or prompt hints.
Last updated 14 days ago