Creating Perfect Audio Loops

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:

image

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.

89 Likes

Ex​cellent tutori​al :)​
Th​an​​​​ks!

1 Like

For those that have FL Studio, you can also make your sounds looped by exporting as wrapped!

3 Likes

I did not know about the OGG files being better for loops.
That changes quite a bit.
Thank you for sharing this information, it will certainly come in handy to many of us!

1 Like

I never imagined I would learn how to edit audio on Roblox.
I was even recommended a good audio editing program. Really great post!

3 Likes

I would like to add onto this post!

There is another reason as why not to use MP3!

OGG and MP3 are both fundamentally different audio formats and are compressed and stored differently.
I’m going to explain you what the differences are.

MP3 format

The MP3 format is an old audio format that was invented back in 1991, the format is at least 30 years old now.

MP3 uses a compression algorithm that removes most unnecessary information and shrink the size of your audio files.

This is generally a good thing, except that back in the time when MP3 was invented, compression algorithms weren’t so cleverly designed yet and still had a lot of limits.

Audio files stored as MP3 will cut off some sound above 15 - 16 khz.

While most people will not perceive a huge difference, MP3 compression can result in some almost audible loss of quality.

This can include things such as sounds being more muffled or losing detail in high pitched sounds.
If you compress music with a lot of drums and high-pitched sounds then it may sound a bit “flatter” and lose depth after compression.

Now the OGG format

Just to get a small misconception out of the way.
OGG is actually just a container for the file format, the REAL name of the format actually is Vorbis.

OGG Vorbis is a more modern compression format, invented in the 2000s, intended to replace MP3.

Vorbis uses a psychoacoustic model for compression which is capable of making the file WAYYYY smaller but also preserves the sound quality (especially high pitched sounds) a lot better!

If you’re an music producer or sound designer you should ALWAYS save audio in a FLAC format if you intend to edit the sound later.

Once you’re about to use the music/sound effect for a project, THEN you convert or render it as an OGG Vorbis file.

Recommended OGG Vorbis settings

I generally recommend you keep the compression settings at quality level 5/10 - 7/10 as this gives a very good balance between quality and file size.

Though after some testing I’ve found out that OGG files will even sound decent at 3/10 - 4.5/10 quality, but this compression setting you should only use if you really intend on prioritizing file size over quality.

Only use it if desperate for storage space as it and expect to lose some frequencies above 17khz.

This is still outside the range of what most humans can hear but just be aware of that in case you intend to slow down or pitch down the sound later.
After slowing down a sound you might be able to hear that it’s compressed.

18 Likes

The Edison audio editor in FL Studio actually has a looping feature.
You can select a region and set it as a loop.

I think the option was called “set loop region”, you can probs find it in the drop down menu if I recall.

1 Like

For those who use Audacity, the approach is exactly the same. The additional detail that isn’t as easily achievable is dragging two audio clips on top of each other that automatically cross-fades over each other.

The list is ordered by usefulness and relativity. I listed “Crossfade Tracks” over “Crossfade Clips” due to there being custom curves.

https://manual.audacityteam.org/man/crossfade_tracks.html
https://manual.audacityteam.org/man/crossfade_clips.html
https://manual.audacityteam.org/man/creating_a_crossfade.html

To add more on the MP3 file format, it actually features a padding which ruins its seamless looping. This is why you see the audio not able to loop for a brief window that could kill immersion.

Now to address the title, “Creating Perfect Audio Loops” is sufficient enough. However, for those who are already in the business and knowing the nomenclatures and all, Creating Seamless Audio Loops would be recommended.

5 Likes

MP3 will not cut off some sound above 15 - 16 khz at 320 bitrate, in my case with my test sound.
If you’re an music producer or sound designer you should ALWAYS save audio in a WAV format, if have enough space.

I’m not sure, but Roblox’s uploader sets audio quality level, so we can just set 10/10 instead.

1 Like

Nice! This will come in handy!