Skip to content

Instantly share code, notes, and snippets.

@daftmugi
Created April 8, 2023 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daftmugi/68bcf3835fdb95e5a7b8148edcc14d38 to your computer and use it in GitHub Desktop.
Save daftmugi/68bcf3835fdb95e5a7b8148edcc14d38 to your computer and use it in GitHub Desktop.
For The Dark Mod, reduce some player footstep sound volumes

How to reduce TDM player footstep sound volumes

Written with Linux in mind.

The following shows how to reduce the volumes of metal and water player footstep sounds.

Extract the footstep sounds

The player footstep sound files are in tdm_sound_sfx02.pk4 (ZIP file).

List player footstep sound files:

unzip -l tdm_sound_sfx02.pk4 'sound/sfx/movement/footsteps/player/*'

Extract player footstep sound files:

unzip tdm_sound_sfx02.pk4 'sound/sfx/movement/footsteps/player/*' -d footstep_sounds

Use FFmpeg Bash script to reduce the volumes

See reduce-footstep-volume.bash file below.

  1. Change to footstep_sounds directory (or the directory where the files were extracted to).
  2. Run the reduce-footstep-volume.bash script.
  3. Copy/Move the resulting output sound files to <darkmod dir>/sound/sfx/movement/footsteps/player.

Example:

cd footstep_sounds
./reduce-footstep-volume.bash
mv -i output/sound ../

Resulting output sound files

sound
└── sfx
    └── movement
        └── footsteps
            └── player
                ├── metal_jump_land01.ogg
                ├── metal_jump_land02.ogg
                ├── metal_jump_land03.ogg
                ├── metal_jump_land04.ogg
                ├── metal_run01.ogg
                ├── metal_run02.ogg
                ├── metal_run03.ogg
                ├── metal_run04.ogg
                ├── water_crouch_run01.ogg
                ├── water_crouch_run02.ogg
                ├── water_crouch_run03.ogg
                ├── water_crouch_run04.ogg
                ├── water_jump_land01.ogg
                ├── water_jump_land02.ogg
                ├── water_jump_land03.ogg
                ├── water_jump_land04.ogg
                ├── water_run01.ogg
                ├── water_run02.ogg
                ├── water_run03.ogg
                ├── water_run04.ogg
                └── water_run05.ogg
#!/usr/bin/env bash
set -eu
IN_DIR='sound/sfx/movement/footsteps/player'
mkdir -p output/"$IN_DIR"
for i in "$IN_DIR"/metal_run*; do ffmpeg -i "$i" -filter:a 'volume=-4dB' output/"$i"; done
for i in "$IN_DIR"/metal_jump*; do ffmpeg -i "$i" -filter:a 'volume=-10dB' output/"$i"; done
for i in "$IN_DIR"/water_run*; do ffmpeg -i "$i" -filter:a 'volume=-10dB' output/"$i"; done
for i in "$IN_DIR"/water_crouch_run*; do ffmpeg -i "$i" -filter:a 'volume=-10dB' output/"$i"; done
for i in "$IN_DIR"/water_jump*; do ffmpeg -i "$i" -filter:a 'volume=-5dB' output/"$i"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment