Left 4 Dead 2

Left 4 Dead 2

71 ratings
Bug-Free Custom Sounds
By Doktor haus
Tired of your speakers/headphones screaming at you, random chipmunk and demon voices? There is currently only one correct way to replace the sounds and this guide will show you how.

 
Rate  
Favorite
Favorited
Unfavorite
Stuff You'll Need
  • Audacity
    [audacity.sourceforge.net]
  • Default sound folder and cache

You need the default sounds and cache for this to work.


Navigate to
Steamapps/common/Left 4 Dead2/left4dead2/sound
If you've modified any sounds within this folder, or you've rebuilt/updated the sound cache, you need to re-download it.


In Steam, right-click Left 4 Dead 2, select properties, then the "Local Files" tab and select "Verify Integrity of Game Cache". Your sound folder should automatically re-download.
Video Tutorial

For those who prefer a visual aid, here's a fairly old video recorded with my crappy old mic.
The Basics
The general rule of L4D2 sound replacement is your sound should match the original in almost every way. Your replacement must:
  • have the same sample rate as the original (mostly 44100hz, occasionally 22500)
  • be the same length as the original
  • have the same # of channels (mono or stereo)
  • be exported in the format .WAV (Microsoft) signed 16 bit PCM


In Audacity, you should always start by importing the sound you want to replace. This makes sure Audacity uses the sample rate you need. You can use File > Import or simply drag and drop a sound into Audacity. Next, import a new sound or two; whatever you want to replace the original.


You'll also want to mute the original sound so you can hear the new one, and so they don't get blended together in export.
Long Replacements

What if your new sound is longer than the original? That's a problem, so select the extra length and delete it.


You might also notice that our sound is mono, whereas the old is stereo. If that's true in your case too, select all of your sound, then choose Edit > Duplicate from the menu.


Next, click the small black arrow at the left of your new track and select "Make Stereo Track".




What if your sound was way too long like this? You don't want your sound to cut off suddenly.


So select a portion of it and choose Effects > Studio Fade Out (plain "Fade Out" works fine too) and you'll see the waveform gradually shrink near the end. Experiment with the amount of sound you fade; whatever sounds best to you is what you should use.
Short Replacements
What if your replacement sound is shorter than the original?


That's also a problem. Select the silence gap between the new and original sounds, then select Generate > Silence from the menu. You're essentially filling in the "blank" so that your replacement sound matches the length of the original.
New Sounds
If you're making new sounds (not replacements), this is for you. Unfortunately, due to L4D2's sound system, you can only add new sounds to custom maps.

The rules here are a lot more lax, but a few basics still apply. Your sounds must be exported as either:
  • 44100 hz 16 bit PCM WAV files with mono or stereo channels
  • 44100 hz 128kbps (constant bitrate) MP3 files with stereo channels.

MP3's have a much lower file size, but cannot use certain sound script features like looping.
And technically, you can use 22500 hz, but why would you want a lower quality?
Anyway, the length should not matter.

Export your sounds and place them in an addons subfolder. For example: steamapps/common/Left 4 Dead 2/left4dead2/addons/my_sounds/sound/my_map/poopscoop.wav

Now, create a "maps" subdirectory in your custom addon folder, then create a new .TXT file and name it "YourMapNameHere_level_sounds". You should replace "YourMapNameHere" with the name of your map's VMF file/s (not the campaign name). For example, my survival map "Gunkanjima" uses the VMF "ttt_gunkanjima_v2", so I'd create "ttt_gunkanjima_v2_level_sounds.txt". If you have more than one VMF, create one for each. Anyway...

Within this text file, you add your sounds.

This is a single entry.
"Poop.Scoop" { "channel" "CHAN_WEAPON" "soundlevel" "SNDLVL_GUNFIRE" "volume" "1.00" "pitch" "100" "wave" ")weapons/poopscoop/fire_1.wav" }

Now, let's go into detail.

Poop.Scoop - Sound event. Name this whatever you want. This is how the engine calls for the sound, not the wav filename. You can trigger this sound only through map entities such as ambient_generic, and can test it ingame by loading up your custom map and entering in the console "playgamesound Poop.Scoop".

channel - What channel of the sound mixer this plays from

soundlevel - How long it takes for a sound to "fade away" and how far off it can be heard

volume - Relative volume. 0.00 is silent, 0.50 is half, 1.00 is full.
If you write it this way, the volume changes randomly between the two values:
"volume" "0.50,0.60"

pitch - Pitch of the sound in a range from 0-255. 100 is the original; anything lower... lowers the pitch, anything higher increases it. Write it like so to create random pitches (great for gunfire):
"pitch" "90,110"

wave - path to a WAV or MP3 file, relative to its root directory.
For example, if you use "weapon/poopscoop/fire_1.wav" as the path, make sure fire_1.wav is in your addon folder's sound/weapons/poopscoop directory. That little bracket ")" at the start of the filepath is a "Sound Character" which tells the engine that sound file has special attributes. Read more about these on the Valve Developer Wiki.

You can also make one sound event play randomly from a list of several sound files. Do it like so:
"rndwave" { "wave" ")weapons/poopscoop/fire_1.wav" "wave" ")weapons/poopscoop/fire_2.wav" "wave" ")weapons/poopscoop/fire_3.wav" }

Have a look here for more info on soundscripts.

When those new sounds are placed in your addon subdirectory, fire up L4D2, bring up the console with ~ and enter "snd_buildsoundcachefordirectory addons/YourAddonFolderHere". A sound cache will be generated for your addon, not for the root game. Now you can pack it into a VPK.
Finishing Up
Let's get down to business (to defeat... the Huns!)

Once everything checks out in Audacity, hit File > Export. Select as the format "WAV (Microsoft) signed 16 bit PCM", make sure you retain the original sound's filename and hit save.

Now, let's open your addons folder. Navigate to
steamapps/common/Left 4 Dead 2/left4dead2/addons
Let's create a new folder here. I'll name it MyAddon for the sake of simplicity. Open that folder and create a new one called "sound". Here's where you'll need to replicate the directory structure of whatever sound you're replacing. For example, since I'm replacing melee_tonfa_01.wav, I need to place the new melee_tonfa_01.wav inside MyAddon/sound/weapons/tonfa.

For non-replacement sounds, you can name your WAV/MP3 whatever you want, and choose or create any directory inside MyAddon/sound. Placing a sound file directly inside "sound" won't work.

After that, all you have to do is pack "MyAddon" into a VPK. Open a new window and navigate to steamapps/common/Left 4 Dead 2/bin, find vpk.exe, right-click it and choose "Make shortcut" or "send to desktop". Now copy-paste this shortcut into your addons folder. Now whenever you want to turn a folder into a VPK, you merely need to drop that folder onto the shortcut, so... do that.

But wait! What if your replacement still pops/cracks/bugs out? It's a rarity, but still happens. In the event, that your sound lengths/channels etc. match up perfectly with the originals but this still happens, try generating a tiny amount of silence (maybe a half second) at the end, to extend it slightly past the original's length.

Aaaand... we're done!


Final word: Don't rebuild/update the game's sound cache or replace anything within the root sound folder. Do that and you'll get bugs. You should only add sound replacements or new entries to VPKs.
< >
15 Comments
Dr. Gordon Freeman, Ph.D Nov 9 @ 8:52pm 
Thx :)
Manímerkén Nov 5 @ 8:47pm 
how can i include a script in a weapon soundmod.vpk to randomly pick between 3 .wav files. Is it even possible?
Dr Dinosaur Aug 7, 2016 @ 5:33am 
This helped. Thanks.
MSF (At College) Jul 6, 2016 @ 11:48am 
I need some help. I've been trying to make a sound mod for the Hunter, and the sounds work to a certain degree; they play, but a lot of the sounds play a click-like sound before and/or after they play. The audio matches the original lenth, and the rate is at 44100 like the original. Any ideas on why it's making these annoying clicks?
A noob that has no life Jul 5, 2016 @ 6:26am 
If you need more info, I can send you the new Boomer sounds that are giving me the 24000Hz error.
A noob that has no life Jul 5, 2016 @ 6:25am 
Last problems are these:

I don't know do I have to change all the sounds for example in the boomer sound folder so I deleted the sounds and folders I didn't touch. In this case I deleted the lurking sounds and also the female boomer sounds. So I compiled the mod into a .vpk file and tested the mod and it gave me the errors I said below as well as still had the female boomer sounds included.

Speaking of the sounds staying, I can still hear the original sounds of the Tank and Jockey and more frequently than the new ones. I changed all the Jockey sounds and few Tank sounds execpt few "fail" sounds and some other crap but still they do the original sounds. Do I have to change all the old sounds in the mod folder for the game not to use the un-modded sounds found in the original sound folder?
A noob that has no life Jul 5, 2016 @ 6:20am 
Other problem is that I keep getting this error saying something like invalid frequency or something along those lines (24000) and "sound /player/boomer/voice/blabla.wav" could not be found. The first error is because I assume it is because I haven't changed the hertz from the original to 441kHz but I've checked Audacity and it says that they are 32-bit, mono and 441000Hz. I even used another program I found from another guide to change the supposed invalid sounds to 16-bit, 441Hz mono and it still gave me that error as well as nothing has changed in Audacity. I may have to redo the sounds unfortunately.
A noob that has no life Jul 5, 2016 @ 6:20am 
Dunno if OP checks this guide but I used some othee guide to replace sounds. I'm currently making a Dead Space mod where I relplace the original sounds and models with the assets of the other games, for example the zombie sounds are replaced with the Necromorphs'. I managed to replace the Jockey (Pack), Boomer (Puker) and Tank (Brute) sounds, but here are the problems.

The sounds are all either too short or too long, so sometimes they play completely or just cut out before a new one begins, dunno if this is because the A.I makes the zombies go from this "idle" pose to "attack" and things like that. I heard that the lenght does not matter but apparently it does.

The Tank footsteps I replaced with the footsteps of the Brute from Dead Space. When I play them in a music player, they sound normal and high quality but in the game they are really low quality and sound like they are from some old 1999 game.
adamthyhedgehog Apr 30, 2016 @ 5:28pm 
Is there a guide somewhere that tells you what uses what?
Doktor haus  [author] Apr 30, 2016 @ 4:28pm 
adamthyhedgehog: Yeah, that's been a long-time bug with the sound scripts.