Game Audio Tutorial – How To Create Seamless Looping Music and Sound Effects Files for Video Games

If you are watching on a mobile device you won’t see the helpful annotations or be able to skip around. Feel free to jump ahead to whatever interests you.

TUTORIAL START (:36 in video)
FIRST OPTION – DUPLICATE MUSIC (1:27 in video)
SECOND OPTION – MUSIC WITH TAIL (4:56 in video)
THIRD OPTION – MUSIC WITHOUT TAIL (7:40 in video)
LOOPING AMBIENCE AND SFX (10:06 or 12:00 in video)

________________________

Hey there Audio Compadres 🙂

When creating music and doing sound design for video games there are a multitude of reasons that sounds need to loop. Oddly enough, most professionals don’t really discuss their methods on how they accomplish this. I mostly wanted to share my methods of looping sounds for the beginners who have no idea how this is accomplished. However, I also think these methods may be of use to other Game Audio professionals who don’t like their current methods of looping sounds.

In each case, the method involves variations of the sames thing:

TAIL – TO FRONT – CROSSFADE

TailToFront

Basically, you take a file, make an edit, take the tail end of that edit, put this tail end edit to the front end of the file, and find a good way to crossfade between them smoothly. In each case, this means something slightly different, but you always take the last section of a file, move it to the beginning of a file, and crossfade it into the other part of your audio file.

I prefer to do the fades of the files on two separate tracks instead of the crossfade tool on a single track. It allows far more flexibility on starting points and fade types!

Also, in ProTools I much prefer recording to a new audio track over bouncing to a file and importing. This is because Bouncing often suffers from adding extra delay and doesn’t perfectly match your in and out points! If you bus your tracks to one audio track and record there isn’t any delay which keeps your in and out points intact 🙂

If your files are very loud it’s best to turn them down a few dB when making crossfades to prevent clipping and then turn up the volume on the final looping audio file to compensate.

Finally, many professionals add a few samples of fade in and fade out ( 4 to 10 samples) to the final files to ensure a perfect loop without popping. See 13:44 in the video for visual reference.

For a more detailed explanation be sure to watch the video I attached to this post. Let’s get started!

 

MUSIC LOOPING

FIRST OPTION – DUPLICATE MUSIC (1:27 in video)

The best option for looping your music is to duplicate the track so it repeats itself completely right after it’s finished. This blends the tail of the full track with the intro of the full track naturally doing most of the work for you. Then you simply make an edit at the 2nd starting point, move the tail end of the edit to a new track, line it up with the start of the first track, find a good place to crossfade that leaves the tail in place, and record the mixed edits into one new audio track.

This gives you a starting point that blends in the tail of the track with the start of the track which will perfectly loop!

SECOND OPTION – MUSIC  WITH TAIL (4:56 in video)

This method is for when you’ve bounced your music with a tail out, but not using the first option I listed above. In this case, make an edit a few bars after the track starts, copy the front end of this edited starting point to a new track, line it up with the tail out of the track, then record these mixed files to a new track. This will give you the same starting point as the first option because you have blended the tail of the track with the tracks start into a new file!

Now you just need to do the steps I listed above for the first option: Simply make an edit at the 2nd starting point, move the tail end of the edit to a new track, line it up with the start of the first track, find a good place to crossfade that leaves the tail in place, and record the mixed edits into one new audio track.

THIRD OPTION – MUSIC WITHOUT TAIL (7:40 in video)

There are times when music is delivered without a tail out. This makes it a bit harder to make a looping file because there isn’t a natural tail to blend with the start of the track. However, a good workaround is to create a “fake tail out” using reverb.

First, make a new track with reverb as an insert. Make a copy of the last two bars and put it on the reverb track.

If the track has a good amount of reverb then try to match that reverb setting. If the track has very little reverb try using a short plate reverb.

Fade out the original track at the end, and fade in the reverb track. Mess with these settings until you can hear a natural sounding tail to your original track. Once you have a good setting record the tracks into one new audio track.

Now you have a file that is the same starting point as option #2 above with a natural sounding tail. So, follow the steps for the second option and you’ll be all set! I’ve written them out below to keep it simple if you are new to this.

Make an edit a few bars after the track starts, copy the front end of this edited starting point to a new track, line it up with the tail out of the track, then record these mixed files to a new track. Make an edit at the 2nd starting point, move the tail end of the edit to a new track, line it up with the start of the first track, find a good place to crossfade that leaves the tail in place, and record the edits into one new audio track.

SFX LOOPING

Looping Ambience and SFX (10:06 or 12:00 in video)

This is a bit easier than looping music. Basically, you choose a point in the file that is the least busy section. Make an edit at that point. Then drag the “tail” end of your edit to a new track as the starting point and the “front” end of your edit point onto a new track as the new tail.

By swapping the front and tail of your sound you are creating a seamless loop because the wave at the edit point is a PERFECT match 🙂 At this point, you simply adjust how you are fading in and out your files. There are no rules on what crossfades sound best with every kind of sound, but I generally use equal power shaped fades as a starting point.

Many people mention to do edits at a zero crossing point, however in stereo files this becomes nearly impossible. Also, if you follow the 4 sample fade in and 4 sample fade out rule on your final looping file you will be fine regardless of where you start your edit.

MP3 looping – Encoding, Bit Reservoirs, and Gaps

So, you’ve come this far and you STILL aren’t done! Now you’ve got to compress your audio and ensure it loops. This will have to be covered in another post because this post is already long enough. However, it’s important to at least understand the MP3s add gaps to your perfectly looping files.

MP3 files add gaps because they commonly add bit reservoirs and an encoder delay (which is variable depending on the encoder used).

In order to ensure your mp3 files loop properly you have to use a tool like MP3 loops to disable the bit reservoir and conteract the encoder delay amount.

I’ve also had good luck with looping files in Unity by creating a .wav file, importing the wav into unity, and allowing Unity to do the conversion inside the tool. Unity uses FMod soundbank generator which creates seamless mp3 loops! This is a VERY cool feature, but only works if you import the .wav.

If you want a full article on compressed files and looping please leave a comment or shoot us an email and we’ll get it up asap!

OVERVIEW

There you have it! Now you can make ANY music cue or audio file into a seamless looping file for your video game! Go forth and get loopy 🙂

If you have any questions after reading this post and watching the video tutorial please don’t hesitate to leave a comment.

– Aaron Brown

Thanks for visiting PlayDotSound! Your best resource for learning about video game sound!
Come back soon for more posts about game audio, sound design, composition, integration using engines like Unreal and Unity, and much more.
 
Play Dot Sound is created by multiple award winning sound designers and composers in the video game audio industry. Our purpose is to educate, connect and inspire both beginners and professionals to make better sounds for their games.