[Example][Tutorial] Add-on sound streaming and file set up

Interested in streaming add-on sounds? Have a bunch of files with custom vehicle audio and want to organize them into one neat resource?

I’ve made an example resource with the correct organization and file structure on GitHub that you can find here:

For this, I used:

As the car audio needed to set this up.

How to Add More Audio Files

When adding new car add-on sounds, look to the original named data_file listings. Please match the file structure as it is in the folder.

data_file 'AUDIO_GAMEDATA' 'audioconfig/roxanne_game.dat'
data_file 'AUDIO_SOUNDDATA' 'audioconfig/roxanne_sounds.dat'
data_file 'AUDIO_WAVEPACK' 'sfx/dlc_roxanne'

These need to match the file names themselves, so don’t use the name of the car, use the name of the audio files as you downloaded them. Do not mess around with the names, most vehicles (which 99% of you will be use this for) that have custom audio files will already have this information set within their vehicles.meta.

Copy the format already present in the fxmanifest.lua. For example for a made-up car addon audio called the issipissi with files using the same name:

data_file 'AUDIO_GAMEDATA' 'audioconfig/issipissi_game.dat'
data_file 'AUDIO_SOUNDDATA' 'audioconfig/issipissi_sounds.dat'
data_file 'AUDIO_WAVEPACK' 'sfx/dlc_issipissi'

Then put it in the fxmanifest.lua file of the resource. Your fxmanifest.lua should then look like this:

fx_version 'cerulean'
game 'gta5'

author 'PrinceAlbert'
description 'Custom Car Audio'

files {
    '**/**/*.dat151.rel',
    '**/**/*.dat54.rel',
    '**/**/*.awc',
}

data_file 'AUDIO_GAMEDATA' 'audioconfig/roxanne_game.dat'
data_file 'AUDIO_SOUNDDATA' 'audioconfig/roxanne_sounds.dat'
data_file 'AUDIO_WAVEPACK' 'sfx/dlc_roxanne'
data_file 'AUDIO_GAMEDATA' 'audioconfig/sunrise_game.dat'
data_file 'AUDIO_SOUNDDATA' 'audioconfig/sunrise_sounds.dat'
data_file 'AUDIO_WAVEPACK' 'sfx/dlc_sunrise'
data_file 'AUDIO_GAMEDATA' 'audioconfig/issipissi_game.dat'
data_file 'AUDIO_SOUNDDATA' 'audioconfig/issipissi_sounds.dat'
data_file 'AUDIO_WAVEPACK' 'sfx/dlc_issipissi'

As far as I can tell you cannot glob the data_files for audio. Do not change the format of the files, use it exactly how I’ve put them and the same naming conventions.

How do add audio to your add-on cars

Open the vehicles.meta of the car you want

Find the audioNameHash line and add the filename as it is written in the original file name. Much of the data in vehicle meta files is case sensitive (lower or uppercase matters):

      <audioNameHash>roxanne</audioNameHash>

Make sure this is ensured before your Add-on Car resource in the server config file. For example:

ensure AddonCarSounds
ensure AddonCars

You can use these for all your native audio, for example, the same format can be used for any police sirens, or other add-on native audio you might produce.

Additional Thanks:

  • Thank you dexvo for clarifying/testing globbing in the fxmanifest.lua with regards to the data_file format.
  • Players on Popcorn RP for being patient while I mess around with their favorite car’s audio files.
1 Like