How to Make Source EngineCompressed, Looping Wavs to Reduce Map Filesize

robotortoise

L1: Registered
Feb 1, 2014
7
3
As someone who's not very well versed in map making, this guide may come off as a little....amateurish.

However, I AM very well versed in song-editing. Specifically, song looping and compression.

If you already know how to make Cue Points in Goldwave, skip to step 7. You can also convert uncompressed .wav songs to this new format with the Batch Processing Feature on Goldwave. Just drag and drop, baby!

Example of the completed project

Anyways, on to the Guide!



How to Compress And Loop A WAV Song


1. Install Goldwave and (optionally) Audacity.


2. Assuming you know what song you're going to use, take the song and import it into Audacity. Video game songs loop incredibly easily, as they were made to loop. Other songs? ...not so much.


3. Find the points you'll be using for the "start" and "end" of the loop. What'll happen is your song will start at the beginning of the .wav, and then hit the "end" point you specified. The song will start over IMMEDIATELY, with no lag, at the "start" point, until it hits the "end" point, at which it'll loop again. I recommend using a program like Foobar2000 with seamless looping, so you can just highlight the "start" thru "end" points and see if it seamlessly loops. If it does, write down the time of the "start" and "end" loop points.

Make sure your sampling rate is at 44100 Hz, if not, resample the tracks and change the project sampling rate, and then you can move on to step 4.


3a. Trim off everything after the "end" loop point to save space, as you won't be hearing it, then export the entire file as a wav. Name it something distinct, like bgm_zeldas_garden_draft.wav, so you don't get it confused with the final project.


4. Open Goldwave. Import the .wav file you just exported from Audacity, bgm_zeldas_garden_draft.wav, and go onto the toolbar. Hit the "Tool" dropdown menu, then click on "Cue Points". Click "New" on the middle-bottom left. Type in the position of the first cue point on your song. This isn't necessarily the beginning of the song. MAKE SURE THE MINUTES, SECONDS, AND HOURS CORRESPOND TO THE AUDACITY TIMESTAMPS YOU WROTE DOWN EARLIER!

If not, it will completely butcher your loop point! Name it something like "start", "A", or "Horse panties", it doesn't matter, as long as it's first on the list, then click OK.


5. Click "New" again, and repeat step 4. If your "end" point was at the very end of your song, don't bother typing the timestamp in, just click "Finish", and it will snap to the end of your song automatically. Click OK.


6. Click "Close" on the top right. Now that your loop points are set, your song is looping! Here's the moment of truth!


7. COMPRESSING AND SAVING YOUR LOOPING WAVE
To save your .wav in a compressed format compatible with TF2 and all Source games, click "File" on the top menu, and then "Save As...".
Click the "Save as type:" drop down menu and select "Wave (*.wav)".
VERY IMPORTANT: Select the "Attributes" drop down menu, and select "Microsoft ADPCM 44.100 kHz, 4 Bit, Stereo, 355 kbps". (Or "Microsoft ADPCM 44.100 kHz, 4 Bit, Mono, 177 kbps" if you have a mono track).
Find your save location, and name your file something you'll remember it as, like bgm_zeldas_garden_looping_compressed.wav", and hit Save.




Ta-daaaa! You just saved a large chunk of map space just by exporting a compressed wav, with minimal quality loss!

:)

If you have any questions about this compression method or guide, let me know!

-Robotortoise [Palutena's Bro]

P.S. Goldwave isn't free, unfortunately. I wish this looping feature and compression method were available in Audacity natively, but alas, what can you do?
If you lack the funds for Goldwave, you can always....sail the seven seas, if you know what I mean. But please support the devs of this software as you support TF2. :)
 
Last edited:

DisruptedHunter

L2: Junior Member
Aug 30, 2009
89
1
Just want to say that he's done this for a few pieces on my maps and it's a life saver for anyone who wants music and doesn't want a gigantic file size and great sounding music.
 

henke37

aa
Sep 23, 2011
2,075
515
Do note that ADPCM is a fixed rate codec that is typically 4bps, as opposed to 16 or 8 bps. It is not nearly as good as more modern codecs.
 

Idolon

they/them
aa
Feb 7, 2008
2,105
6,106
While I haven't checked to make sure, I'd bet you could export to those settings in Audacity. I messed around with different .wav formats a while back when I was writing a soundtrack for a Source game, and I found that a lot of different settings worked fine.
 

Idolon

they/them
aa
Feb 7, 2008
2,105
6,106
I was able to export it in the format I wanted from Audacity, then loop it up in Wavosaur and hit the Save button (which presumably kept it in the same format).
 

robotortoise

L1: Registered
Feb 1, 2014
7
3
I was able to export it in the format I wanted from Audacity, then loop it up in Wavosaur and hit the Save button (which presumably kept it in the same format).

Maybe I should just ask the Audacity devs if they'll support looping wavs in the future.

Personally I don't like Wavosaur or Goldwave's UI either.
 

Idolon

they/them
aa
Feb 7, 2008
2,105
6,106
If I remember what I read correctly, the Audacity devs have come out and said they won't be supporting looping for the foreseeable future because it's not a standard feature of the format (or something similar).
 

robotortoise

L1: Registered
Feb 1, 2014
7
3
If I remember what I read correctly, the Audacity devs have come out and said they won't be supporting looping for the foreseeable future because it's not a standard feature of the format (or something similar).

Oh. I literally just emailed them about it.