SNDINFO

SNDINFO is a text lump used in Hexen to associate internal sound references to sound lump names. While it offers some flexibility in allowing to replace sounds, it does not, however, allow to create new sound definitions, as they are still hardcoded.

Oddly, it is also used to associate MIDI tracks to maps, even though CD tracks are associated to maps in MAPINFO.

Specifications
A SNDINFO lump contains comments, commands, and sound definitions. A comment begins with a semi-colon (';') and continues to the end of the line: ; This is a SNDINFO comment. A command begins with keyword prefixed with a dollar character ('$'), for example $map. Unknown commands are ignored. $MAP   41              Winnowr A sound definition begins with the logical name of a sound and follows with its lump name. The full list of recognized logical sound names is found in the array in sounds.c from the Hexen source code. Ambient1               insects1

Note that with the exception of comments, the Hexen SNDINFO parser does not pay attention to line endings. While unknown commands are ignored, the following token will be parsed, which can provoke problems. In fact, if the comments were removed, Hexen's SNDINFO lump could be collapsed into a single line.

Three commands are used in the Hexen SNDINFO lump:
 * $archivepath:This commands uses one parameter, a directory path. The value found in the Hexen IWADs is "o:\sound\archive\". This path replaces the content of the internal variable ArchivePath. In practice, it has no effect when found in a SNDINFO lump embedded in a wad. For it to be used, the SNDINFO must be in an external file, and Hexen must be run with the -devsnd  parameter. Instead of loading the sound lumps from the IWAD, they will be loaded from file with the same name and the .lmp extension, found in the given directory. For example, instead of loading PIGRUNT1 from the IWAD, it will try to load o:\sound\archive\pigrunt1.lmp.
 * $map: This commands uses two parameter, a map number and a lump name. It associates a MUS lump to a map. This music is used as a fallback if the Hexen CD (or any other CD with audio tracks) is not in the computer's CR-ROM drive; preventing audio CD music from being played. Oddly, the audio CD track numbers are assigned to maps in the MAPINFO lump, which would have been a more logical place for MIDI music as well.
 * $registered:This command has no effect. Nothing references it in the source code. It is unclear what purpose it would have been intended to have, since it is also found in the SNDINFO lump from the demo version of Hexen.

Extensions
The ZDoom source port extended and generalized SNDINFO so as to let it create entirely new sound definitions, including sound aliases and random sound choices. Other source ports which allow defining new sounds generally use a different system entirely, such as the Eternity Engine's ESNDINFO lump, which uses EDF syntax.