Skip to content

sounds.json

Embin edited this page Nov 26, 2024 · 3 revisions

The sounds.json file is used by the game to determine what sound files to load, and what settings to give to each sound.

You can view the vanilla sounds.json file here.

There are 2 audio groups, music and sound_effects. A sound can be put in either group and have their volume be controlled by the volume setting/slider for the audio group.

Basic File Structure

Each sound group has an array that contains each sound effect.

{
  "music":[],
  "sound_effects":[]
}

Each sound effect is an object in these arrays, which contains data like the sounds name and whether or not the sound should loop.

Below is a basic example.

{
  "file":"example_sound.mp3",
  "name":"cool_sound",
  "loop":true
}

file is the file name of the sound effect, which will be in a folder with the name of the audio group the sound is in. external can be used instead of file for when you want to use a link to a sound file from a external website. This is mainly used by sounds in the music sound category, to keep the file size of the gamedata.zip file down.

The supported file types are .mp3, .wav, and .ogg.

name is the name of the sound used in game. It is prepended with the sound group and namespace, so for example, if you were to make a sound in the fwb namespace under the music audio group with the name sigma_music, it would be called fwb:music/sigma_music in game.

loop is a boolean that determines whether or not the sound will loop when it is played in game. This is mainly used by sounds in the music sound group. If omitted, it will default to false.

Other Sound Settings

There are more optional sound settings than just loop, such as volume.

{
  "file":"example_sound.mp3",
  "name":"cool_sound",
  "loop":true,
  "volume":150,
  "pitch":100,
  "detune":-100,
  "reverb":{
    "time":100,
    "decay":100,
    "mix":50
  },
  "gain":100
}

volume defaults to 100 when omitted.

Clone this wiki locally