SNDINFO
From ZDoom Wiki
SNDINFO contains many sound-related definitions. It allows any sound referred to by its lump name (DSSAWHIT, DSBAREXP, etc) to be associated with any game event sound such as player pain, death, and secret finding. The names by which the predefined sounds are referred to in SNDINFO are fairly self-explanatory, so I will not cover them now.
SNDINFO lumps are cumulative. All SNDINFO lumps found are read in WAD directory order. This means that you don't have to (in fact you must not) copy all information from the original SNDINFO lump if you want to change something.
SNDINFO supports the following commands:
- sound assignment (logicalname lumpname)
- This does not use a specific command. Just write the two names on one line in the file, the logical name (that's the name that's uses in the other commands here, in the game or in other lumps that use sound name) first and the lumpname of the sound that is to be used second.
- $random aliasname { logicalname1 logicalname2 logicalname3 ... }
- Defines a random sound. The newly defined alias can be used like a regular sound but any time it is used one of the sounds specified in the list is randomly selected. The number of sounds in the list is unlimited. Note that for this to work the logicalnames within the brackets must be assigned to real lumpnames on separate lines. (See example below)
- $alias aliasname soundname
- Assigns a second logical name to an already existing sound. The existing sound can also be a random sound or another alias. Any change to the original sound in subsequent SNDINFO lumps is automatically transferred to the new sound.
- $limit soundname <amount>
- Specifies that at most <amount> instances can be played at once. A value of 0 means no limit at all.
- $singular soundname
- Specifies that this is a sound that should not be interrupted. The sound will not get cutoff by further instances of itself or other sounds of equal priority.
- $pitchshift soundname <range>
- Specifies how much the pitch of the specified sound may be randomly altered when it is played. <range> may be in the range of 0 to 7.
- $pitchshiftrange <range>
- Sets a default pitch shift value that is applied to all subsequent sound definitions.
- $volume soundname volume (development version only)
- Specifies a modifier to apply to this sound's volume whenever it is played. This value is multiplied by the volume specified in the script or actor definition triggering the sound to determine the final volume. Default is 1.0.
- $playersound playerclass gender logicalname lumpname
- Defines a sound used by a player. <playerclass> must be 'player' if the sound is used for a stock Doom, Strife, or Heretic class. If it is for a custom class, it can be named anything, so long as Player.SoundClass uses the same name. In Hexen it can be either 'fighter', 'mage' or 'cleric', in addition to any custom classes for the game. Gender can be 'male', 'female' or 'other'. Here you can find a list of all known player sounds and their meaning. If you wish to use additional sounds for custom skins, you use this like custom classes by defining the sounds that you wish to use, but instead you put the skin name into the <playerclass> string.
- $playersounddup playerclass gender logicalname otherplayersound
- Creates an alias to the existing player sound.
- $playeralias playerclass gender logicalname otherlogicalsound
- Creates an alias to the existing logical sound.
- $playercompat playerclass gender logicalname compatibilityname
- Defines a compatibility alias for a specific player sound. If any sounds with these compatibility names are defined later, they will redefine the corresponding player sounds instead. Likewise, if they are played, they will play the corresponding player sound instead.
- $ambient index logicalsound type mode <volume>
- Defines an ambient sound which is played when an ambient sound thing (14065) is placed in a map. <index> specifies which thing or which parameter for the generic ambient sound thing has to be used. <logicalsound> specifies the sound to be played, <volume> the volume at which it is played.
- type can be one of the following:
- point [atten]
- Defines a positional sound. The volume at which the sound is played decreases with distance. The optional parameter <atten> specifies how quickly this decrease occurs, with larger values meaning a faster falloff in volume. This is specified as a floating point value. The default for <atten> is 1.0.
- surround
- Plays the sound at full volume in surround mode.
- world
- Plays the sound at full volume regardless of distance. The keyword 'world' is optional.
- mode can be one of the following:
- continuous
- Plays the sound as a repeating endless loop.
- random <minsecs> <maxsecs>
- Plays the sound at random intervals. The minumum and maximum length of this interval can be specified in seconds. Both values are floating point numbers.
- periodic <secs>
- Plays the sound at regulat intervals. The length of these intervals is specified in seconds as a floating point value.
- $ifdoom
- $ifheretic
- $ifhexen
- $ifstrife
- Reads the following definitions up to the next $endif only if the specified game is played.
- $map mapnumber musicname
- This was the way level music was defined in Hexen. It is merely provided for compatibility and should not be used anymore. Level music should be defined in the MAPINFO lump with the rest of the level's parameters.
- $musicvolume musicname factor
- Sets a volume scaling factor for music tracks. This is used to compensate for music that has audibly different volume.
- $registered
- This command is defined for Hexen compatibility but completely ignored.
- $archivepath string
- Unused for now
- $mididevice device
- Sets the default device to use to play a given song file, which can be useful if the song only sounds good using one of the playback methods. You can set to use Timidity or Windows Synth, or can force OPL playback for MUS files.
An interesting note: ZDoom supports different player pain sounds depending on health. In Doom, Heretic and Hexen there is only one player pain sound, so it is handled like this in SNDINFO:
$playersound player male *pain100 dsplpain $playersounddup player male *pain75 *pain100 $playersounddup player male *pain50 *pain100 $playersounddup player male *pain25 *pain100
The *pain100 used instead of a lump name for pain75, pain50, and pain25 to refer to tells those sounds to refer to pain100 for a sound lump to play. If you want you can change this, though, so you really have different pain sounds.
Another feature of the player sounds is that you can specify a custom damage type for pain and death sounds. You do this by defining the sound as follows:
$playersound player male *death-fire dsburn
When the player takes damage, ZDoom will attempt to find a sound with the matching damagetype first, and then will fall back to the generic sound (e.g. *death) if it's not found.
Examples
This example randomizes the player's death sound to one of three different sounds:
$random pl_death { player/death1 player/death2 player/death3 }
player/death1 pldth1
player/death2 pldth2
player/death3 pldth3
$playeralias player male *death pl_death
Note that the actual sounds that will be played when a player dies are pldth1, pldth2 and pldth3.
See also
- Predefined sounds - A copy of the SNDINFO lump included with ZDoom.

