User Tools

Site Tools


ded:sound

Sound (DED)

A Sound definition is used to define the presence and in-game playback characteristics of a sound effect sample.

Core Concepts

Sample References

A reference is used to link actual sound data samples to a Sound definition. Only one sample reference is actually required and in general, only one is specified in each definition. If multiple references are specified they will be tried sequentially until one succeeds, in the following order (top to bottom):

Linked Sounds

The Link, Link Pitch and Link Volume parameters should never need to be used under normal circumstances. It could also be largely considered a legacy feature as one can write their own sound definitions for almost everything these days.

Several actors in the original Heretic (and also the Chaingun in Doom, though this particular case is broken) used the same sound for multiple things. In the early days, to give modders more flexibility, these uses were given separate sound definitions.

Linking Sound properties make this possible without breaking DeHackEd support. Essentially, if Dday calls a sound def with a link field, it will use the linked to sound def instead.

Syntax

Sound {
  Id = "";
  Name = "";
  Ext = "";
  Lump = "";
  File = "";  
  File Name = "";  
  Flags = "";
  Group = 0;
  Max Channels = 0;
  Priority = 0;
  Link = "";
  Link Pitch = 0;
  Link Volume = 0;
}

Id

Unique identifier of the sound. Used as a reference to this sound in other definitions. Note there is no limit on length, spaces etc.

Name

Unique symbolic name of the sound. Used as a reference to this sound only in sndinfo and sndseq definitions.

Ext

Name of a sound file. Used to locate the sample from a native or virtual file (e.g., in a ZIP). See Sample References

Lump

Name of a sound lump. Used to locate the sample from a WAD archive. See Sample References

File

Alias of Ext

File Name

Alias of Ext

Flags

Flag Description
shift Use type 1 periodic random frequency shifting on the sample.
shift2 Use type 2 periodic random frequency shifting on the sample (x2 magnitude).
exclude When sample playback begins all other playing samples in the same group will be stopped (otherwise just those of the same emitter will stop). Used in conjunction with the exclusion group feature.
nodist Sample will always be heard at full volume.
repeat Sample playback will repeat continuously until stopped (either by another sound or an in-game action). Used in conjunction with the exclusion group feature.
dontstop Sample playback will never be stopped by another sound.

Group

Sound exclusion group. If non-zero all other sounds in the same group will be stopped when this one sound is started. For example, in Doom a group is used to ensure that both the chainsaw rev up and idle sounds cannot be heard playing simultaneously.

Max Channels

Maximum number of sound channels this sound is allowed to populate simultaneously.

Priority

Priority of the sound. This is used for determining which sound to play when the “One sound per emitter” option is enabled. A high priority sound will cause a lower-priority one to be stopped from the same emitter.

Note that this value is ignored when the “One sound per emitter” option is disabled. Instead, sound priorities are calculated dynamically based on time, distance, and volume.

Examples

# (Basic) Using a lump sample.
Sound {
  Id = "pistol";
  Lump = "DSPISTOL";
}

# (Intermediate) Using a native file sample with greater priority and shift.
Sound {
  Id = "pistol";
  Ext = "sound/kaboom.wav";
  Flags = shift2;
  Priority = 64;
}
ded/sound.txt · Last modified: 2020-11-27 04:41 by skyjake