Sound Recording Quality (with Goldwave)
Quake2 Demo Editing Tutorial

Written 6/99 by Overman

          

When you import a sound for use in a Quake2 demo or movie, it sometimes appears that you have two choices:  either enormous file-size or extremely low quality.  This is not a hard and fast rule, as there are steps you can take to convert a high-quality .wav file into a more compact version that still sounds surprisingly good from inside the game. 

This tutorial will assume that you have a great sounding .wav file that you want to make more efficient to download.  The sound editing program we will be using for these procedures is Goldwave, which has a shareware trial period and very reasonable registration fee (if you should consider it -- as I did -- worth the meager fee).  If you are more familiar with another sound editing program, you should be able to apply these principles to your program.  If you need Goldwave, click here.

Quality vs. Size: Factors

We are going to start with a high quality sound, click here to download the sample sound (1520 kb).  Before we begin, let's outline the different factors that affect a .wav file's size and quality. 

Boosting Sound Volume

Whenever possible, it is always a good idea to perform any sound edits/effects/deformations on the high-quality version of your sound, rather than after you have resampled it.  The reason for this is simple:  effects and manipulations tend to apply themselves more effectively to a high quality sound.   Additionally, sometimes digitally processed effects tend to add some unwanted high-frequency noise to the sound... much of which can be eliminated during our down-sampling procedures which will follow. 

That being said, we want to "distort" our sound with one effect, called Compression.   Compression can be used for a variety of purposes, most of which involve some variation of the following:  bring lower volume portions up, and bring higher volume portions down.  The result is a "flatter" sound with more consistent volume levels throughout.  Radio stations use heavy compression on their broadcasts for this very reason, so that a listener can set their radio volume once, and not strain to hear quieter portions nor be overwhelmed by louder portions of the broadcast.

While we are not going to heavily compress our sound, it's good practice to apply a bit of compression to assist in consistent playback.   Click the Effects drop-down menu, and select Dynamics from the list.  From the list of Preset Shapes at the bottom, select Soft Clip.  Notice the nice smooth compression curve.  Click OK to apply the compression.

Now that we have a sound with more consistent volume levels, we want to make sure that we have the wave set to play back at it's highest possible volume level (we will do this for all our sounds, thereby giving consistency throughout the demo).  From the toolbar at the top of the Goldwave window, select the button with a volume knob and an arrow pointing up and down (mouse hover will reveal it to be Maximize).  In the dialog that pops up, keep the volume indicator at 1.000 (default) and click OK..  This will bring the volume of the entire sound up to the highest possible level without creating distortion (digital distortion arises when the sound volume is too high).

Saving Space - Bits and Channels

Our example sound is a 16-bit Stereo recording at 44100 Hz, taken from the Quake2 CD soundtrack, weighing in at 1520kb.  All of this information about the sound can be easily viewed in Goldwave.  Look around the lower part of the program window and you will see these three key pieces of information:  1) Wave signed 16-bit;  2) Stereo;  and 3) 44100 Hz.

We can take care of two of these file-reduction issues right away in one simple step:  saving as a new file.  From the File drop-down menu, select Save As...  I highly recommend you choose a new filename (sample2.wav, for example) so that if you want to start over with your original sound, you can do so.  Before clicking Save, set the File Atttributes to:  8-bit mono unsigned.  Now click Save.   Goldwave will ask you if you want to update the window with your new sound, choose Yes.

What have we done here?  First of all, by changing from stereo to mono, we have cut the file size in half, since stereo = 2 tracks, and mono = 1 track.  This is a necessity, since Quake2 does not support stereo .wav sounds.  Secondly, by changing the file from 16-bit to 8-bit, we have reduced the file size by half again.  In this one easy step, we have converted a 1520kb file into a 381kb file.  There is still more we can do.

Resampling the Sound

In the same way that changing from 16-bit to 8-bit cut our file size in half, the same can be said for reduction in sample frequency.   Currently, the sample frequency is at 44100Hz.   Quake2 itself uses sounds sampled at 22050Hz, but many movie makers have found that 11025Hz is not only a smaller file, but still sounds very good from within Quake2.  All of the sounds in Father Frags Best, for example, had a sample rate of 11025Hz

Commonly, the procedure is to simply downsample the sound to 11025Hz and save... but this can be a mistake, and can result in unnecessary noise in your final sound.  This downsample noise is, however, easily avoidable.  Here's why...

The sample rate of a sound actually indicates what frequencies that sound will reproduce on playback.  The actual frequency level reproduced by a sound is always one half it's sample rate.  So, for example, our 44100Hz sound reproduces frequencies up to 22050Hz (one half of 44100).  This is typically referred to as "CD Quality Sound", since it tends to cover the complete range of human hearing (20Hz to 20000Hz).  Therefore, we know that a 22050Hz sound reproduces frequencies up to 11025Hz (half of sample rate), and a 11025Hz sound reproduces frequencies up to 5512.5Hz (half of sample rate).

Keeping this in mind, if we take our 44100Hz sound and downsample it to 11025Hz, then the frequency "ceiling" will change from 22050Hz to 5512.5Hz.  So everything between 5512.5Hz and 22050Hz is "lost" in the conversion.  That, in itself, is not the problem.  The question arises... what happens to the "lost" frequencies? 

Those "lost" frequencies are not really lost at all, but instead they are squished into the top of the new frequency ceiling (5512.5Hz).  The result is a high-pitched noise throughout the converted sound that can be very annoying to listen to. 

To avoid this "squishing" and the resulting noise, it is wise to first remove the part of the sound in that "lost" frequency range, and only then proceed to downsampling.  Goldwave makes this very easy to perform.

From the Effects drop-down menu, select Filters, and then Low/Highpass... What we want to do is create a filter to pass our sound through, which will remove the frequencies in that "lost" range.  Type 5513 in the Cutoff Frequency box, and keep Filter Options at Lowpass and Static.  Now set the Steepness to 20 (all the way to the right).  What we are telling Goldwave to do is:  allow all frequencies lower (Lowpass) than our Cutoff Frequency (5513... the .5 will not matter) to pass through unchanged, and cut off the rest of the frequencies with no tolerance (Static, Steepness 20).  The result will be a sound that has no frequencies higher than 5513Hz... we have eliminated the "lost" range.  Click OK to apply the filter.

Now that the filter is complete, we can safely change the sample rate from 44100Hz to 11025Hz with no unnecessary noise generated.  From the Effects drop-down menu, select Resample.  In the Rate box, type or choose 11025.  Click OK to apply the change.

Finishing Up

Our procedures are complete, we can now save the file again (as 8-bit mono unsigned).  This sound file is now only 96kb in size, instead of 1520kb!  You are now ready to import this sound into Keygrip2 and hear it in Quake2. 

The steps we have covered here are the ending steps to the sound editing/design process.  There may be many other effects you apply early on to get the kind of sound you want... or you may even be designing a sound from scratch.   In any case, this tutorial has shown you how to prepare your sound for it's most efficient packaging (and smallest download size) while still keeping quality in mind.   If your sound is of different characteristics than our sample sound (perhaps a different sample rate or whatever), the same exact steps still apply.  Use these techniquies to make your recam or movie download as "economical" as possible, and your modem viewers will thank you for it.