The Doom engine games played sound through DMX, a sound library by Paul Radek. Each sound
effect is in the WAD twice: for a sound card, as samples in a lump whose name starts
DS, and for the PC speaker, as a list of tones in a lump whose name starts
DP. Heretic and Hexen name their sounds freely and keep only the digital
ones. Numbers are little-endian.
DMX digital sounds
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | format | Always 3. |
| 2 | 2 | u16 | rate | Samples a second: 11025 in the Doom IWADs. |
| 4 | 4 | u32 | count | The number of samples that follow. |
| 8 | count | u8 | samples | 8-bit unsigned mono samples: 128 is silence. |
The Unofficial Doom Specs describe the header as four 16-bit numbers (3, the rate, the count and 0), which is the same bytes for any sound shorter than 65,536 samples. The DMX library skips the first 16 and the last 16 samples, which in the IWADs are copies of the first and last real sample. Chocolate Doom does the same, and does not play a sound of 48 samples or fewer, or one whose count is more than the lump holds. The explorer plays the samples between the paddings, links each to its byte, and opens the sound as a WAV file.
0format03 002 bytes2rate11 2B(11025)2 bytes4count64 00 00 00(100)4 bytes8padding copies of the first sample16 bytes24samples the sound68 bytes92padding copies of the last sample16 bytes
PC speaker sounds
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | format | Always 0. |
| 2 | 2 | u16 | count | The number of tones. |
| 4 | count | u8 | tones | One tone for each 140th of a second: 0 for silence, otherwise a note, 1 to 96 in the IWADs, which the sound library looks up in a table of frequencies. |
The explorer lists the tones with their times. It does not play them, because the frequency table is part of the sound library, not the WAD.
GENMIDI
Music was played on the OPL2 FM chip of AdLib and Sound Blaster cards with the
instruments in GENMIDI. The lump starts #OPL_II# (8 bytes),
then 175 instruments of 36 bytes, the OPL register settings for each, then 175 names of
32 bytes padded with zero bytes. The first 128 instruments are the General MIDI
programs; the other 47 play percussion notes 35 to 81. The explorer lists the names. A
Gravis Ultrasound used the patch list in the text lump DMXGUS instead.
Other sound lumps
Source ports also read ordinary sound and music files kept as lumps: WAV, Ogg, FLAC, MP3 and MIDI. The explorer knows them by their first bytes and opens each as a file of its own.