Make "categories.dat" replaceable

This came up in a recent discussion on the Cfx.re Discord guild.

As of right now, there is no way to replace the “categories.dat” data file or change any of its values via native calls.

This would be really useful though, as this would enable the option to control volumes of specific audio categories. Especially because you can’t replace audio packs from the residents.rpf, where most of the weather sounds are located (afaik).

(Main use-case for me would be to reduce the volume of thunder and rain sounds, as some users find these too loud in comparison with other ambience sounds.)

Wouldn’t exposing those open it up to abuse? People muting categories to give themselves an upper hand in combat or something?

Sorry, should have clarified I meant replaceable in resources.

Like:
data_file 'AUDIO_CATEGORIES' 'audio/config/categories'

FiveM/RedM ship with custom categories.dat files which include special mumble categories to handle the “native audio” integration.

If it was replaceable by users(yes I would consider the average server admin a user) it would require additional handling, as in injecting a pseudo category from code, to not produce some very hard to diagnose audio bugs.

Your concerns regarding “wrong” category overwrites make total sense.

Does providing a native function for this brings the same concerns regarding wrong usage, or would this allow to correctly parse/“reject” passed flags?

Something like SetAudioCategoryValue("speech_breathing", "Volume", "-1300") (probably a bad name) to allow settings flags with <Name> as key?