Creating Sounds

Most sound effects start with a natural recorded sound and then are edited to add effects. For example, in the original Star Wars movie, the engine sound of one of the starships was the sound of a lion roar played backward. Start with an organic sound of things around you, such as a car starting, a door shutting, someone sneezing, or a bathtub draining. When recording, be sure not to record at too high of a level, or the sound will clip and sound distorted. Try to record at a good midrange level-not too loud and not too quiet. Also, make use of a noise-reduction filter using your sound tool. This will help eliminate background noises and make up for cheap, lo-fi microphones. When you've got your recorded sound, apply filters and effects to make the sound interesting, or try combining two or more separate organic sounds. You'll probably want to avoid "fake" sounds, such as a sound effect that is obviously a person trying to imitate a gunfire noise. Remember, in many sound tools, filters are "destructive," meaning the audio samples themselves are modified. Keep a copy of the original sound, in case you've applied so many filters that you need to revert back to it. Of course, sound effects don't have to originate from an organic, recorded sound. You can also use waveform generation in many sound tools to create artificial sounds. Finally, make sure your sounds start and end with zero amplitude to eliminate popping, as in . Don't add too much of a delay at the beginning, though, or there will be a longer delay before your sound is heard.

Make sure the sounds start and end with zero amplitude.
Make sure the sounds start and end with zero amplitude.

Here are a few examples of how sounds were created for this tutorial:

Another good example of creating sound effects is from one of the first Java games I created, a 3D first-person shooter called Scared. This was a standard first-person shooter in which the player runs around a maze, opening doors, finding keys, and advancing to the next level. Here are a few examples from that game:

Come to think about it, most of the sounds for that game were inspired by Dr Pepper.

Sound File Formats

We discussed sound file formats back in , but we rehash this topic a bit here. Basically, the Java Sound API can read three formats: AIFF, AU, and WAV. Additionally, you can install other format readers from third parties, such as an OGG decoder. For the tutorial, we used 16-bit, mono, 44,100Hz WAV files, which is CD quality, but mono instead of stereo.