(info) Most of the information here is for Warzone 3.1 and above.

Including audio in a mod

A short guide that shows how to add custom audio files to a mod...

 

Step 1 - Create folder structure

You'll need the following structure in your mod (some of the config files might not be needed - see later):

 <your mod>.wz or  <your mod>

 audio

 audio.cfg ← required if you have added new sound files or volume/looping updates to existing files

 *.ogg ← if you are adding new audio files, they should go in the audio folder or a subfolder

 stats

 weaponsounds.txt ← required if you are changing weapon sounds

 wrf

 audio.wrf ← required if you have added new sound files

Depending on what your mod does, you'll probably need other folders, but those listed above are the ones that you'll need for audio stuff.

Step 2 - Put audio files in audio filder

It is standard practice to keep all audio files inside the 'audio' folder or a subfolder within it.

If you want to override an existing audio file, give it the same filename and put it in the same folder path (relative to the 'audio' folder) as the original.

If you want to add a new, unique audio file, ensure it has a unique filename and ideally create a new subfolder (within 'audio' folder) to separate it from the game's audio files.

Step 3 - Update config files

If you've added a new audio file, you'll need to create an audio.wrf in the 'wrf' folder and define the folder (if not using an existing folder) and filename.

If you've added a new audio file or want to change the volume/looping of an existing file, you'll need to create an audio.cfg in the 'audio' folder.

If you're adding or changing weapon sounds, you'll need a weaponsounds.txt in the 'stats' folder.

Step 4 - Test it

After installing your mod test it in the game. You can use the Javascript API's playSound() function to play audio files.

Warzone requires all audio files to be in Ogg Vorbis format.

See: Creating OGG audio files
If you want to change the menu or in-game music, see Music for more details. 

Troubleshooting

If you run in to problems:

  • Make sure the path to the audio file, and the audio file name, is properly defined in audio.wrf
  • Make sure the audio file is defined in audio.cfg
  • Make sure the file is Ogg Vorbis format
  • File paths and names are case-sensitive and need the .ogg extension