Team Fortress 2

Team Fortress 2

42 ratings
How To Make Sound-Sprays
By GreenSwede
This guide will teach you what soundsprays actually are, how to make one yourself as well as some helpful tips and tricks to make the soundspray sound as good as possible using some compression techniques while respecting the 512 KB file size limit.
   
Award
Favorite
Favorited
Unfavorite
What are "soundsprays"?
A soundspray is a playable custom sound Wave file that you're able to play and hear while connected to a server with other players (does NOT apply to Casual servers, sv_allowupload has to be set to 1). Playing the soundspray makes it so other players around you will be able to hear it as well, and you have full freedom to choose what you want your soundspray to sound like. Think of it like a noisemaker except this is a soundfile that you upload for other players to hear.

Where does the term "spray" come from? Well, soundsprays also have to be under 512 KB in file size just like ordinary sprays. And similarly to sprays, the sound you decide to play will be downloaded by connected players in your server who also have custom sounds enabled (sounds are downloaded and stored in the tf/sound/temp folder).
l'm interested, how do I enable custom sounds?
In order to be able to use your own soundspray + hear other players' soundsprays, you have to make sure that this command is enabled by setting it to 1:

cl_customsounds 1


The easiest way of making sure that this command is always set to 1 is by writing it in your tf/cfg/autoexec.cfg file.

If you can hear your soundspray playing just fine but other players are unable to, they probably don't have the command set to 1. The command has to already be set to 1 before joining a server, or they need to reconnect for the change to take effect.
I already got a Wave (.wav) soundfile under 512 KB in file size, how do I start?
If you have a soundfile already that's ready to be used, the easiest place to store it is in your Team Fortress 2/tf2 root directory. They can be placed inside subfolders too.

After that is done, simply specify your sound filename using this command:
cl_soundfile soundfilename.wav
Example:

If they're placed inside subfolders, it will have to look like this as an example:
"cl_soundfile sound/soundsprays/sewer_surfing.wav"

The following sample rates are possible:
  • 11025 Hz
  • 22050 Hz
  • 44100 Hz
In addition, TF2 supports stereo as well as mono channels.
16-bit depth, 8-bit depth as well as 4-bit depth is also supported.

Finally, bind this command to any key so that you're able to easily play your soundspray:
impulse 202
Example key that I like to use is Keypad 0 (Insert):
bind "kp_ins" "impulse 202"
512 KB in file size is too small, how do I compress it further?
If your soundfile is long in length or requires a high sample rate, the best compression to use without sacrificing too much audio quality is by using Microsoft ADPCM compression. This compression uses a 4-bit depth on each channel.

Many audio editors support Wave Microsoft ADPCM compression. Free audio editors I can recommend that supports it are:

The "Export as WAV" window for Audacity looks like this:



The "Save As..." window (Attributes...) for GoldWave looks like this:
How long can I make my soundspray while staying under 512 KB?
Here is a table showing approximately how long the audiofile length can be while using Microsoft ADPCM compression, depending on the sample rate and the sound channels (Mono/Stereo).

Microsoft ADPCM
Sample Rate
Sound Channels
Length
File Size
11025 Hz
Mono
1:32
~511 KB
11025 Hz
Stereo
0:46
~511 KB
22050 Hz
Mono
0:46
~511 KB
22050 Hz
Stereo
0:23
~511 KB
44100 Hz
Mono
0:23
~511 KB
44100 Hz
Stereo
0:12
~511 KB
How do I make my soundspray loop?
To make your soundspray loop when it reaches the end, I can recommend using GoldWave as the process is very easy.

  1. Open the soundfile in GoldWave

  2. Click on the Cues button



  3. Click on the green cross button that says "New..." in the bottom left corner

  4. Give your Cue Point a name, e.g. start

  5. Have the position set at "Beginning of file"

  6. Click on OK and close the Cue Points window

  7. Now save your changes

Now your soundspray will loop back to the beginning. If necessary you can adjust the starting cue point position as well.
Soundspray samples available for download!
Feel free to download[bbaka.moe] and use these as soundsprays!

big_apple (Microsoft ADPCM, 22050 Hz, Mono, 0:45)

sewer_surfing (Microsoft ADPCM, 22050 Hz, Mono, 0:37)

hotel_mario (Microsoft ADPCM, 22050 Hz, Mono, 0:44)

sad_8_bits_adpcm (Microsoft ADPCM, 44100 Hz, Stereo, 0:11)

asuka_120percent_AS06_mono_adpcm_22khz (Microsoft ADPCM, 22050 Hz, Mono, 0:43)

oj_alija_aljo_loop (Microsoft ADPCM, 44100 Hz, Stereo, 0:08)

suckdicks_lipsync (PCM lossless, 44100 Hz, Stereo, 0:01)
Troubleshooting
  • "I'm unable to hear my soundspray in-game now but it worked fine before. What's wrong?"
    This could be due to old sound .cache files. Try deleting all .cache files by searching for them in:
    ...\Steam\steamapps\common\Team Fortress 2\tf

    I have written a Windows batch script that automatically deletes all .cache files. It first checks if the script is running from the "tf" root folder as a safety precaution. You can copy the code or download it directly from Pastebin[pastebin.com].

    You may also try to delete all soundfiles stored in the tf/sound/temp folder. Additionally make sure that the server allows custom sounds, sv_allowupload has to be set to 1. As mentioned earlier Valve's servers does not support custom sounds. You also need cl_customsounds set to 1.


  • "I can't get the sound loop to sound right when using Microsoft ADPCM compression..."
    This can be tricky to get right sometimes due to the compression. You may notice a small sudden extra bit of silence at the end of the file which wasn't there before applying the compression. Try splitting the end of the soundfile just a little earlier by about half a second or less and see if that improves the loop. This is a trial and error process.


  • "The soundfile volume is pretty low in-game..."
    You'll have to increase the volume of your soundfile. Source games tend to make sounds play at a noticeably lower volume. A tip is to normalize the audio level and increase the volume as high as possible without risking audio clipping.
Any questions?
Write a comment!
45 Comments
nyanezt Apr 25 @ 5:09pm 
Very useful guide! I recently learned that this feature was not in fact scrapped for obvious reasons, but still is in the game, it's just obscure and almost nobody uses it (nor do some servers allow it)
GreenSwede  [author] Feb 20 @ 9:32pm 
If some sounds aren't being heard then it could be worth a try to delete the sound .cache files. If sounds fail to load then the console should give a hint at what fails, including the temp wav filename.
Cirno Feb 20 @ 7:29pm 
Maybe the x64 update caused this, but my own custom sound files from my custom folder are now being heard by my friend partially, and the other sounds just don't play for him anymore.
He can hear Impulse 202 fine though, but unfortunately if you have sound files in your custom folder it seems to jankly "leak" into the other player's sounds if they have cl_customsounds enabled.
dr. kleiner Jul 2, 2024 @ 12:12pm 
sound sprays isn't working on casual only because sv_pure 1 block sound/temp/*
GreenSwede  [author] May 12, 2024 @ 4:52am 
Soundspray samples have been reuploaded as a .zip: https://bbaka.moe/QfxLrKeHJoSM.zip
lightwo May 12, 2024 @ 4:11am 
Sounds like you'll have to download a beta branch of the game older than the x64 release, and store it outside of where Steam tracks it to prevent having it update.
GreenSwede  [author] May 11, 2024 @ 10:16am 
Been many years since I used it, but it might not work after the 64-bit update.
missing May 11, 2024 @ 9:54am 
Thank you! Also, do you know how to make lip sync for these sprays, right? I made one back in 2021 I think but now I couldn't make hlfaceposer.exe work, it just crashes every time when I try to launch it, no matter what. Do you know how to fix it?
GreenSwede  [author] May 11, 2024 @ 9:37am 
Oh now I understand. I'll try to re-upload them within the next 24 hours.
missing May 11, 2024 @ 5:38am 
It just says "This content is no longer available." when you click on these links