feat(extra-natives-five): add a global vehicle audio volume control#4078
feat(extra-natives-five): add a global vehicle audio volume control#4078xalva98 wants to merge 1 commit into
Conversation
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.
|
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 |
|
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 |
|
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. |
function getValueFromVolume(volume: number) {
return 1 - (volume / 100);
}
const scene = "mutes_vehicles_scene";
StartAudioScene(scene)
SetAudioSceneVariable(scene, "apply", getValueFromVolume(45)) // 45% of max volumeThen 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 👍 |
|
That's why I didn't understand the goal of this PR, since it can be done easily by script |
|
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 |
|
But what's the usecase ? If vehicle are too loud it's server problem, GTA has made audio equilibrated |
|
@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 |
|
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 |
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
VEHICLESaudio category(
0x74B31BE3). The feature creates anaudCategoryControllerManagercontrolleron 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.
GetInstance/CreateController) already exist inNuiAudioSink.cppfor the Mumble voice-volume feature; this reuses the same pattern on the
VEHICLEScategory.profile_vehicleVolume(archive convar)inputs. I've added a slider for volumes which is easier to use in my opinion.
SET_/GET_AUDIO_VEHICLE_VOLUMEnative handlers are present but commented outwhile gen8 is in feature freeze.
This PR applies to the following area(s)
FiveM, Audio
Successfully tested on
Game builds: 3258
Platforms: Windows
Checklist
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.