Looping a sound
Intro
In this short tutorial you will learn how to loop a .wave sound file. (.mp3 can't be looped via cue points) Looping sounds in Source requires a simple short process to be made. Sounds cannot be simply looped by un-checking the Is NOT Looped flag of a ambient_generic. Instead you must add cue/loop points to the sound file. To do so, we must use a sound editing program that add cue points or loop points. There are many programs available for sound editing and some can create loops. Here are a few known programs:
- GoldWave - There is a free trial version available, after it ends you will need to buy Goldwave. Once it is installed you are ready to begin.
- Sony Sound Forge - This program is a lot more expensive than GoldWave and is able to read loop/cue points. Todo: Does this program do everything necessary for looping, like editing and detecting loops in official wav files?
- Wavosaur - This program is completely free (donations are accepted by the author). It appears to be able to detect loops in all wav files. Cue points in GoldWave are read as Markers in Wavosaur. There is no need for installation. Just open the application and editing can start immediately.
Adding the Loop with GoldWave
Open Goldwave and open the sound you want to loop. Click the cues icon. ()
Then in the new window click on the New button and add a cue point At Start. Then click New for another cue point and add a point At End. So it looks similar to this:


Conclusion
Save your file and it's loop-ready. Now when you use a ambient_generic and un-check the Is NOT Looped flag with your sound it will loop in game correctly. On a side note, you can also decide to set the starting cue point right in the middle of the wave sound. Basically, the engine will play the sound quite normally from the start, and when it will reach the end, instead of jumping back to the begining of the sound, it should go back to the first cue point. For example, it could be used for a motor sound, where the engine starts and then idle for a moment. The idling part could be looped without the startup part.
See Also
- ambient_generic
ambient_music
- Music Composition
- Sound and Music
- Soundcache
- Sound Download Sites
- Soundscapes
- Soundscripts
- Category:Sound System
External Links
- Goldwave - Official Website
- Sony Sound Forge - Product Page
- Wavosaur - Official Website