Skip to content
[06-02-05] - DefineSound
Duke Nukem 3D

[06-02-05] - DefineSound

Learn how to use the DefineSound command in Duke Nukem 3D to customize sound effects, pitch, priority, flags, and volume for your game experience.

By ···10 min read·Multi-source verified
1 reading this guide  

Learn how to use the DefineSound command in Duke Nukem 3D to customize sound effects, pitch, priority, flags, and volume for your game experience.

Alright, let's talk about the DefineSound command in Duke Nukem 3D. This is how the game's developers set up all the sounds you hear, from Duke's one-liners to the ambient noises and enemy growls. Think of it as the master control panel for the game's audio!

The basic structure looks like this:

definesound <SOUND_IDENTIFIER> <SOUND_FILE> <PITCH_MIN> <PITCH_MAX> <PRIORITY> <FLAGS> <VOLUME>

Let's break down what each part means:

  • SOUND_IDENTIFIER: This is simply the name you'll use to refer to the sound within the game's code.
  • SOUND_FILE: This is the actual audio file (like a .wav or .ogg) that gets played.
  • PITCH_MIN and PITCH_MAX: These two control how much the pitch of the sound can randomly vary each time it plays. It's a neat trick to make sounds feel less repetitive. The exact correlation to Hertz isn't known, but it adds a nice touch of variation.
  • PRIORITY: This determines which sounds get cut off if too many are trying to play at once. Higher priority sounds will override lower priority ones.
  • FLAGS: This is where things get interesting! You can combine these numbers to set special properties for the sound:
    • 1: Makes the sound loop continuously.
    • 2: Marks the sound as ambient. If the player has ambient sounds turned off, these won't play.
    • 4: This flag is for sounds that are specifically Duke's voice lines. If Duke's voice is turned off, these won't play. It also seems to prevent pitch changes when Duke is underwater.
    • 8: This flag censors the sound. If 'adult mode' is off, this sound won't be heard.
    • 16: Honestly, nobody's quite sure what this one does. It's present in the game files, so it likely had a purpose at some point, or maybe it's for something we just don't know about yet.
    You can add these numbers together to enable multiple flags. For example, setting FLAGS to 12 (4 + 8) means the sound is both a Duke-talk sound and is censored, so it won't play if Duke's voice is off OR if adult mode is off.
  • VOLUME: This lets you adjust the sound's volume. A value of 0 means it plays at its original volume. Positive numbers increase it, and negative numbers decrease it. Again, the exact decibel correlation is unknown, but it's your volume knob.

So, if you ever wanted to tweak the game's audio, this is the command you'd be using. It's pretty powerful stuff!

100% Human-Written. AI Fact-Checked. Community Verified. Learn how AntMag verifies content