Skip to content

feat(extra-natives-five): add a global vehicle audio volume control#4078

Open
xalva98 wants to merge 1 commit into
citizenfx:masterfrom
xalva98:vehicle-audio-volume
Open

feat(extra-natives-five): add a global vehicle audio volume control#4078
xalva98 wants to merge 1 commit into
citizenfx:masterfrom
xalva98:vehicle-audio-volume

Conversation

@xalva98

@xalva98 xalva98 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Goal of this PR

Let players lower (or fully mute) only vehicle sounds - engine, exhaust,
tyres, horns, alarms, collisions - without affecting weapons, footsteps,
ambience or music.

Timeline.1.1.mp4

How is this PR achieving the goal

Vehicle audio all descends from the RAGE VEHICLES audio category
(0x74B31BE3). The feature creates an audCategoryControllerManager controller
on that category and sets its linear volume - the same mechanism the game uses
for its own SFX/Music sliders. Setting the parent category scales every child
vehicle sound in one place.

  1. The controller wrappers (GetInstance / CreateController) already exist in
    NuiAudioSink.cpp
    for the Mumble voice-volume feature; this reuses the same pattern on the
    VEHICLES category.
  2. Exposed as the convar profile_vehicleVolume (archive convar)
  3. The F8 menu previously rendered numeric convars as text
    inputs. I've added a slider for volumes which is easier to use in my opinion.

SET_/GET_AUDIO_VEHICLE_VOLUME native handlers are present but commented out
while gen8 is in feature freeze.

This PR applies to the following area(s)

FiveM, Audio

Successfully tested on

Game builds: 3258
Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code is properly formatted and follows the existing style.
  • Commit message is clear and follows the project conventions.
  • This PR introduces no new compilation warnings.

Fixes issues

Ears hurting from driving modded vehicles that have obnoxiously loud modded engine sounds

PS: I've tried implementing this functionality using existing natives, but I wasn't successful—hence the PR.

Scale all vehicle audio (engine, exhaust, tyres, horns, ...) via a
controller on the RAGE VEHICLES category, without affecting other audio.
Exposed as the archived convar profile_vehicleVolume and an F8 slider
under Game. Also adds int/float slider rendering to the dev menu.
@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Jul 18, 2026
@lLukDreams

Copy link
Copy Markdown
Contributor

Are you able to put it into the escape menu? this is for sure something needed for this annoying pay to win cars but i feel it would make more sense from the user experience to put it besides the escape menu settings

@CeebDev

CeebDev commented Jul 18, 2026

Copy link
Copy Markdown

What's the point of having this when you can literally change any volumes of SFX independently, including vehicle sounds, by script ?

I think it's server owners that should decide to either let people change the volume (even if it can be like cheating, e.g. cutting all sounds and only enabling vehicle sounds in a chase to know the position of a purchased vehicle),

or let server owners create a "sound scene" for example, only lowering the weather volume so all players play with the same sounds (SFX volume lowered or raised for all scenes at once) and no player has an advantage.

@xalva98

xalva98 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

What's the point of having this when you can literally change any volumes of SFX independently, including vehicle sounds, by script ?

I think it's server owners that should decide to either let people change the volume (even if it can be like cheating, e.g. cutting all sounds and only enabling vehicle sounds in a chase to know the position of a purchased vehicle),

or let server owners create a "sound scene" for example, only lowering the weather volume so all players play with the same sounds (SFX volume lowered or raised for all scenes at once) and no player has an advantage.

The point is not needing to edit 100+ files

@CeebDev

CeebDev commented Jul 18, 2026

Copy link
Copy Markdown

What's the point of having this when you can literally change any volumes of SFX independently, including vehicle sounds, by script ?
I think it's server owners that should decide to either let people change the volume (even if it can be like cheating, e.g. cutting all sounds and only enabling vehicle sounds in a chase to know the position of a purchased vehicle),
or let server owners create a "sound scene" for example, only lowering the weather volume so all players play with the same sounds (SFX volume lowered or raised for all scenes at once) and no player has an advantage.

The point is not needing to edit 100+ files

What ? The script is like 100lines in a single file

@xalva98

xalva98 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

What's the point of having this when you can literally change any volumes of SFX independently, including vehicle sounds, by script ?
I think it's server owners that should decide to either let people change the volume (even if it can be like cheating, e.g. cutting all sounds and only enabling vehicle sounds in a chase to know the position of a purchased vehicle),
or let server owners create a "sound scene" for example, only lowering the weather volume so all players play with the same sounds (SFX volume lowered or raised for all scenes at once) and no player has an advantage.

The point is not needing to edit 100+ files

What ? The script is like 100lines in a single file

Enlighten me

@CeebDev

CeebDev commented Jul 18, 2026

Copy link
Copy Markdown

In fact the 100 lines is just config file but it's like 2 native calls StartAudioScene and SetAudioSceneVariable

@xalva98

xalva98 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

In fact the 100 lines is just config file but it's like 2 native calls StartAudioScene and SetAudioSceneVariable

I tried that without any success so if you can share a snippet on how to target vehicle/engine sounds only then this PR is of course pointless.

@CeebDev

CeebDev commented Jul 18, 2026

Copy link
Copy Markdown
function getValueFromVolume(volume: number) {
	return 1 - (volume / 100);
}

const scene = "mutes_vehicles_scene";

StartAudioScene(scene)
SetAudioSceneVariable(scene, "apply", getValueFromVolume(45)) // 45% of max volume

Then if you need to update volume you just have to call this again without the start call

SetAudioSceneVariable(scene, "apply", getValueFromVolume(70)) // 70% of max volume

@xalva98

xalva98 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author
function getValueFromVolume(volume: number) {
	return 1 - (volume / 100);
}

const scene = "mutes_vehicles_scene";

StartAudioScene(scene)
SetAudioSceneVariable(scene, "apply", getValueFromVolume(45)) // 45% of max volume

Then if you need to update volume you just have to call this again without the start call

SetAudioSceneVariable(scene, "apply", getValueFromVolume(70)) // 70% of max volume

Works like a charm didn't even know that could be done 👍

@CeebDev

CeebDev commented Jul 18, 2026

Copy link
Copy Markdown

That's why I didn't understand the goal of this PR, since it can be done easily by script

@n3xuuu

n3xuuu commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

It can be done via a script, but I still think it would be nice for players to be able to change it on their own through a command or via audio settings, since most servers likely don’t have the feature you're talking about

@CeebDev

CeebDev commented Jul 18, 2026

Copy link
Copy Markdown

But what's the usecase ? If vehicle are too loud it's server problem, GTA has made audio equilibrated

@lLukDreams

Copy link
Copy Markdown
Contributor

@CeebDev there are a lot of servers with extrem loud cars since people pay for that and are not interested to make them quiet, i can fully understand to give the users self the option since this is annoying af

@CeebDev

CeebDev commented Jul 18, 2026

Copy link
Copy Markdown

Yeah so players can just change server if it's badly developed

I mean if server owner decide to put shit stuff on their server, fivem shouldnt give a bandaid to players

If this is implemented we should at least allow server owner to have controls to avoid unfair advantage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants