How to dynamically list all game sounds for an admin RageUI menu?

Hi everyone,

I’m developing an admin menu with RageUI for FiveM that allows admins to test all available game sounds.
Right now, I’m using a “static” approach: I have a soundsList table with {AudioRef, AudioName} for each known sound:

local soundsList = {
    {AudioRef = "HUD_MINI_GAME_SOUNDSET", AudioName = "10_SEC_WARNING"},
    {AudioRef = "MP_MISSION_COUNTDOWN_SOUNDSET", AudioName = "10s"},
    -- etc...
}

for i, sound in ipairs(soundsList) do
    RageUI.Button(sound.AudioName, nil, {}, true, {
        onSelected = function()
            PlaySoundFrontend(-1, sound.AudioName, sound.AudioRef, true)
        end
    })
end

Issues:

  • The list is huge and hard to maintain.
  • It’s impossible to know all the existing AudioRef / AudioName combinations.

So now, is there a cleaner approach than keeping a massive static list?
Are there any natives or existing resources to make an “audio explorer” menu for admins easier?
How can we dynamically retrieve game audio? Large servers already do this, so it’s not impossible.

Thx all.