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

Discussion in 'Tutorials & Resources' started by robotortoise, Jul 10, 2014.

  1. robotortoise

    robotortoise L1: Registered

    Messages:
    7
    Positive Ratings:
    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. :)
     
    • Thanks Thanks x 3
    Last edited: Sep 3, 2014
  2. DisruptedHunter

    DisruptedHunter L2: Junior Member

    Messages:
    89
    Positive Ratings:
    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.
     
    • Thanks Thanks x 1
  3. henke37

    aa henke37

    Messages:
    1,832
    Positive Ratings:
    420
    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.
     
  4. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    I use Wavosaur for this. It is free and does looping.
     
    • Thanks Thanks x 1
  5. robotortoise

    robotortoise L1: Registered

    Messages:
    7
    Positive Ratings:
    3
    But can it export in that setting which compresses it?
     
  6. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    I don't really remember. I only used it once quite awhile ago for something that was short so I wasn't that concerned about filesize anyway.
     
  7. Idolon

    aa Idolon the worst admin

    Messages:
    1,421
    Positive Ratings:
    4,154
    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.
     
  8. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    But the crux of the problem is audacity doesn't support looping cues, so that wouldn't help us.
     
  9. Idolon

    aa Idolon the worst admin

    Messages:
    1,421
    Positive Ratings:
    4,154
    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).
     
  10. robotortoise

    robotortoise L1: Registered

    Messages:
    7
    Positive Ratings:
    3
    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.
     
  11. Idolon

    aa Idolon the worst admin

    Messages:
    1,421
    Positive Ratings:
    4,154
    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).
     
  12. robotortoise

    robotortoise L1: Registered

    Messages:
    7
    Positive Ratings:
    3
    Oh. I literally just emailed them about it.