Difference between revisions of "SNDINFO"

From DoomWiki.org

[checked revision][checked revision]
m (Extensions: EE has rudimentary Hexen-level SNDINFO support.)
(Fixed a tiny typo)
Line 15: Line 15:
 
Three commands are used in the Hexen SNDINFO lump:
 
Three commands are used in the Hexen SNDINFO lump:
 
;<tt>$archivepath</tt>:This commands uses one parameter, a directory path. The value found in the Hexen [[IWAD]]s is "o:\sound\archive\". This path replaces the content of the internal variable <tt>ArchivePath</tt>. 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 <tt>[[Parameter#-devsnd|-devsnd <sndinfo_file>]]</tt> 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.
 
;<tt>$archivepath</tt>:This commands uses one parameter, a directory path. The value found in the Hexen [[IWAD]]s is "o:\sound\archive\". This path replaces the content of the internal variable <tt>ArchivePath</tt>. 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 <tt>[[Parameter#-devsnd|-devsnd <sndinfo_file>]]</tt> 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.
;<tt>$map</tt>: 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.
+
;<tt>$map</tt>: 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 CD-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.
 
;<tt>$registered</tt>: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.
 
;<tt>$registered</tt>: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.
  

Revision as of 11:50, 5 August 2015

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 sfxinfo_t S_sfx[] 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 <sndinfo_file> 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 CD-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.

In the Eternity Engine's case, SNDINFO is also supported for Hexen compatibility, but most ZDoom extensions will be ignored, and some will cause the lump's contents to be discarded entirely.

External links