ai-voice
Proximity voice with ranges, radio with several frequencies, and phone calls with a loudspeaker, on FiveM Legacy and Enhanced. Stands in for pma-voice.
ai-voice lets players talk to each other. Nearby players hear each other by distance, players on the same radio frequency hear each other anywhere while the radio key is held, and players in the same phone call hear each other anywhere. It runs on both FiveM Legacy (Mumble) and FiveM for GTA V Enhanced (server voice channels).
What it does in the game
- Voice ranges. Players switch between the ranges you set (Whisper 1.5 m, Normal 3 m, Shouting 6 m by default) with the voice range key. The HUD shows the range.
- Radio. A player can listen to several frequencies at once (3 by default) and talks on the active one while holding the radio key. A click plays when someone starts and stops talking (each player can turn it off).
- Job frequencies. Frequency ranges can be locked to jobs or gangs (police on 1 to 10). A player who loses the job or goes off duty leaves those frequencies automatically.
- Radio animation (off by default): the character holds the shoulder radio or a handheld radio while talking. Job frequencies can pick their own animation.
- Phone calls. Players in the same call hear each other anywhere. Phone scripts put players into calls.
- Loudspeaker. A phone script can turn a call's loudspeaker on: players next to the phone hear the call, and (by default) the call hears them too.
- Sound effects. Radio and phone voices are filtered like a speaker or a phone.
- Admin mute.
/muteplymutes a player for some time. The mute survives a reconnect. - Player volumes. Each player can set their own radio and call volume; the panel sets where they start.
Installation
The AI Core txAdmin recipe installs it. By hand: put the folder in resources/[ai]/ and add ensure ai-voice to server.cfg after ensure ai-core. It needs ai-core. It has no database table.
- Remove pma-voice, mumble-voip and TokoVOIP: ai-voice answers their names.
- ai-voice sets
voice_useNativeAudioandvoice_useSendingRangeOnlyitself. - On FiveM Enhanced, the radio and phone sound effects and scripts that use Mumble directly (tgiann-radio-v2, tgiann-phone, lb-phone's effects) need
setr sv_mumble truein your cfg. - pma-voice convars you already have (
voice_defaultVoiceMode,voice_enableRadios,voice_defaultRadioVolumeand the others) are read once at the first start and copied into the panel for every setting still at its default. From then on the panel wins. voice_defaultCycleandvoice_defaultRadioset the keybinds' default keys.
Panel settings
Open the admin panel (F10) and pick Voice.
Settings tab
Voice system: FiveM Legacy talks through Mumble; FiveM for GTA V Enhanced through server voice channels.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Voice system | Automatic picks the server voice channels when the server has them (Enhanced), else Mumble. A change applies when ai-voice starts again. | Automatic / Server voice channels (Enhanced) / Mumble (Legacy) | Automatic |
| In use now | Read only: the system ai-voice runs on now. |
Voice ranges: how far a player is heard. Players switch between these ranges with the voice range key.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Ranges | The list of ranges, each with a Name and a Distance (how far this range carries). | 1 to 6 ranges, 0.5 to 100 m each | Whisper 1.5 m, Normal 3 m, Shouting 6 m |
| Starting range | The position in the list a player starts with (1 = the first range). | 1 to 6 | 2 |
| Players can change their range | Off keeps everyone at the starting range (scripts can still change it). | on / off | on |
| Mumble reach factor | FiveM Legacy only: players within the range times this number receive the voice (Mumble's audio fades out over a longer distance than the range). 3 is pma-voice's value. | 1 to 5 x | 3 |
Radio: players on the same frequency hear each other anywhere while the radio key is held.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Radio on | Turns the radio on or off for everyone. | on / off | on |
| Radio volume | How loud others sound on the radio, in percent. Players can change it for themselves. | 0 to 100 % | 30 |
| Frequencies at once | How many frequencies a player can listen to at the same time; they talk on one of them. | 1 to 10 | 3 |
| Radio sound effect | Filters the voice like a speaker. On FiveM Enhanced this needs setr sv_mumble true. | on / off | on |
| Effect taken over by | Read only: a running script that brings its own effect (tgiann-radio, tgiann-radio-v2). ai-voice's effect stays off while it runs. | ||
| Radio clicks | A click when someone starts and stops talking on the radio. Players can turn it off for themselves. | on / off | on |
| Send names to radio members | Radio scripts that list members get each member's character name. | on / off | off |
Radio animation: what the character does while talking on the radio.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Radio animation on | Off: no animation on any frequency. Scripts can also turn it off for one player. | on / off | off |
| Animation | Used on every frequency without its own animation. | Hand on the shoulder radio / Talking into the shoulder radio / Radio held in the hand / Custom | Hand on the shoulder radio |
| Animation dictionary | Custom only: the animation dictionary. | text | random@arrests |
| Animation name | Custom only: the animation clip. | text | generic_radio_enter |
| Animation flag | Custom only: the TaskPlayAnim flag. 49 = upper body, loops, can walk; 50 = upper body, holds the last frame, can walk. | 0 to 1023 | 49 |
| Radio animation in vehicles | Plays the animation while sitting in a vehicle too. | on / off | on |
Phone calls: players in the same call hear each other anywhere.
| Setting | What it changes | Values | Default |
|---|---|---|---|
| Phone calls on | Turns calls on or off. | on / off | on |
| Call volume | How loud the other side sounds, in percent. Players can change it for themselves. | 0 to 100 % | 60 |
| Phone sound effect | Filters call voices like a phone. Switch it off when your phone script brings its own call effect (lb-phone with CallEffects is not detected). | on / off | on |
| Effect taken over by | Read only: a running script with its own call effect (tgiann-phone). | ||
| Let players' games join calls | Off (safe): only server scripts put players into calls, or a phone script that checks each join. On: any player could join any call; needed by phones that join calls from the player's game, such as lb-phone. | on / off | off |
| Phone loudspeaker | Phone scripts can turn a call's loudspeaker on: players standing next to the phone hear the other side. | on / off | on |
| Loudspeaker reach | Players within this many metres of the phone hear the call. | 0.5 to 15 m | 3 |
| Loudspeaker volume | How loud the loudspeaker sounds, in percent. | 0 to 100 % | 60 |
| The call hears the people around | The other side of the call also hears the players next to the phone. | on / off | on |
The game has a small fixed number of sound effect slots and cannot remove one. Switching an effect off stops using it; players free its slot only by restarting the game.
Frequencies tab
Radio frequencies only some jobs can join, and their animation. Each record is a range of frequencies; press New frequency range to add one. Frequencies outside every range are open to everyone.
| Setting | What it changes | Values | Default for a new range |
|---|---|---|---|
| Name | The name in the list (for example "Police radio"). | 1 to 48 characters | |
| From frequency | The first frequency, as the radio shows it (1, 1.5...). | 0.01 to 1,000,000 | 1 |
| To frequency | The last frequency. Must not be lower than the first. | 0.01 to 1,000,000 | 10 |
| Jobs | Only members of these jobs can join. Leave jobs and gangs empty for everyone. | job names | police |
| Gangs | Members of these gangs can join too. | gang names | empty |
| Only on duty | Job members must be on duty in that job. | on / off | on |
| Animation | The radio animation on these frequencies: the default one, none, or a set. | default / none / a set | default |
Commands
| Command | Arguments | Who | What it does |
|---|---|---|---|
/muteply | <id> [seconds] | admins | Mutes a player's voice, or unmutes a muted player. seconds defaults to 900 (15 minutes), at most one year. The player is told. |
/voicedebug | none | admins | Prints every player's range, frequencies and call to the server console. |
Keybinds
| Default key | What it does | Name in GTA settings |
|---|---|---|
| F11 | Changes the voice range | Change voice range |
| Left Alt | Talks on the active radio frequency while held | Talk on the radio |
The defaults come from the convars voice_defaultCycle and voice_defaultRadio when you set them. Both show in the HUD's key hints ("Voice range", "Radio").
Works with other scripts
- Stands in for pma-voice (
providespma-voice,mumble-voip,tokovoip,toko-voip,tokovoip_script): its exports, state bags and events, so radio, phone and HUD scripts written for pma-voice run unchanged. - tgiann-radio works. tgiann-radio-v2 and tgiann-phone run without their custom pma-voice files; ai-voice turns its own radio or phone effect off while they run.
- lb-phone needs Let players' games join calls on, and ai-voice's phone effect off if you use lb-phone's own call effects.
- ai-hud shows the range, talking and the radio.
Known limits
- Player commands of pma-voice (
/vol,/setvoiceintent) do not exist; players use their own keybinds and the radio script's settings. - On Enhanced, a script range from the player's own game (
overrideProximityRange) is refused: server scripts set ranges there. - Restarting ai-voice keeps each player's range, active frequency and call, but not the extra frequencies they listened to or the loudspeakers.
- A changed Voice system applies at the next start of ai-voice.