Hi! I’m a sound designer at Roblox, and I wanted to show you how to loop sounds, so they play indefinitely and seamlessly to the point where the listener can’t tell they’re looping. This is an essential way for filling an environment with ambience, creating music, bringing life to props like air conditioners and fountains, or even creating satisfying UI.
But there’s a problem! Recorded sounds almost never loop perfectly. Even very monotonous sounds like an air conditioner humming will click and pop at their loop points if you don’t first take the time to edit them a bit!
Luckily there’s a very easy way to fix this problem with audio editing. This demonstration uses Reaper 7 which is one of the most common Digital Audio Workstations (DAWs) for game sound design. It also has a free trial period with full functionality, so even if you don’t want to purchase the full license, you can still use it to follow along and learn!
Pick your audio file
Today I’ve chosen this suburban ambience recording to make into a perfect loop:
While the original sound is about 40 seconds long, for demonstration purposes we’re using a 12 second clip. Keep in mind that length is an important thing to consider when making a loop, if something is too short, it runs the risk of being too obvious when it loops! If your ambient wind track is only 4 seconds long, your player will notice it’s looping and may even turn the sound off because of how annoying it is.
It’s ideal in most cases to make your loops invisible to the player, so for ambience tracks try to shoot for at least 15 seconds. If your sound is much more consistent in tone, like the sound of an air conditioning unit, you may only need 6-10 seconds to sell the illusion.
Once we have our sound, we’re ready for the next step.
Find a zero crossing
Next we have to go on a hunt for a good loop point in our file! We want to find a zero crossing somewhere in the middle of our audio.
What is a Zero Crossing?
- A zero crossing is a small point in a sound where the waveform crosses the middle axis, in other words there’s no sound in either the left or right channel. If you looped this small sample of the sound, it would be silent, or very close to it.
The vertical playhead in this image shows a zero crossing, or a place where both channels cross the X axis or “0”
Why do we want to find one?
We’re looking for a zero crossing because that’s where we’re going to create our loop point! By using a point where the sound has no amplitude, we’re ensuring our sound won’t “pop” or “click” suddenly when we play it.
I’m using a stereo sound in my own example here, which has a Left and a Right channel, but if you’re using a mono sound with one channel, you’re in luck! It’s much easier to find a zero crossing in a mono file because you only have one channel to worry about. Stereo sounds are a bit harder because you have to look for a place where both channels cross zero at the same time.
If you’ve found your loop point (zero crossing), you’re ready for the next step!
Create the loop
Make a cut in your sound at the zero crossing, creating two sound clips from your original one.
Next, move the second clip so it plays before, and fades into the second.
That’s about it! Easy enough right? It’s at this point that you can listen to your sound to see how it feels. If you loop it, does it feel repetitive, can you hear the fade transition? If there’s anything you’re not happy with, experiment with moving the fade points or maybe even pick a different zero crossing.
Export as .OGG
Once you’ve created the new looped clip, we’re ready to export as an OGG file!
Why not .MP3?
If we exported this sound as an .MP3 right now, we’d be very sad when we went to play it in our game…
Mp3 files unfortunately are not suitable for loops, because they add a few milliseconds of silence to the beginning of the sound! This creates a very unprofessional sounding click each time the sound loops. Take a listen to what that would sound like.
Exporting in .OGG or .WAV
Luckily there’s a simple alternative to .mp3! We can just use the much more common game audio format .OGG! .OGG files don’t have this problem, and will loop seamlessly. .WAV is also a common file type for this application, but it’s also a much larger file type so, we’ll stick with OGG for this tutorial.
Done!
Once you’ve exported your sound, you should be good to go! Throw your sound in your game and listen to your seamless loop. Here’s what our final example sounds like.
For additional information on using Sound in Roblox, check out our technical documentation.