← All postsSeamless Loop Game Music: Fix Clicks and Gaps
Read in:EnglishفارسیFrançais

Seamless Loop Game Music: Fix Clicks and Gaps

· 9 min read· 9 viewsgame musicseamless looplooping audiowavgame audio

To make a seamless loop for game music, write it as a whole number of bars, render it so the end of the file leads straight into the start, and fold the reverb tail back onto the beginning instead of letting it trail off as silence. Then play it with sample-accurate looping, never by restarting the file, so there is no click and no gap.

Last reviewed: October 2026

Why do game music loops click or have a gap?

A loop fails audibly for one of four reasons, and it helps to identify which one you have before changing anything.

  1. Silence at the end of the file. Most DAWs export up to the last note and then a little reverb tail, or they pad with silence. When the file wraps, the player hears that silence as a gap.
  2. A tail that is cut. The reverb or delay from the final bar is chopped at the file boundary, which sounds like a sudden drop in the room sound.
  3. A waveform discontinuity. If the last sample and the first sample are at very different levels, the jump is a click. This usually happens when the cut lands mid-note or mid-cycle.
  4. Engine-side restart delay. If the game stops the sound and calls play again, decoder startup and scheduling add a small gap even when the file itself is perfect.

Fixes 1 to 3 are done in the audio file. Fix 4 is done in how the engine loops the sound.

What makes a loop seamless in the first place?

A seamless loop has a musical length that is an exact number of bars, a start and end that line up on the beat grid, and audio that continues naturally from the last sample to the first.

Write the loop so that bar one follows the last bar harmonically. That usually means the final bar either resolves to the tonic's pickup or sits on a chord that can lead back to the first chord. Loops of 4, 8 or 16 bars are common practice because they match typical phrase lengths, but the right length is whatever your material needs. Longer loops reduce repetition fatigue for music that plays for minutes at a time, while short loops suit stingers and menu beds.

Keep tempo constant and bar-aligned. If your loop is 8 bars at 120 BPM in 4/4, its length is 16 seconds exactly, which is 16 x sample rate in samples. Having the length land on an exact number of samples is a useful sanity check; if your export is a few milliseconds longer, the loop will drift against anything synced to it.

How do I handle the reverb tail so the loop does not drop out?

This is the step most people miss. A reverb tail continues after the last note, and a loop needs that tail to appear at the start of the next pass, because that is where it would be if the music kept playing.

The standard technique is tail wrap-around:

  1. Render the loop with extra time after the end, long enough for the reverb and delay tails to decay.
  2. Take the audio past the loop boundary (the tail) and mix it onto the beginning of the loop, aligned sample for sample.
  3. Trim the file to the exact loop length.

The result is that the start of the file already contains the decaying room sound from the previous pass, so the join is inaudible. Without this step, the loop either has a hole in the ambience at the seam or the reverb abruptly resets.

A cheaper alternative is to render the loop twice back to back, keep the second pass, and trim to one loop length. The second pass naturally contains the tail from the first. Either way, check the seam by looping a short region around it and listening with headphones.

What are loop points and how do I set them?

Loop points are markers that tell a player where to jump from and to. For a whole-file loop, the start is sample 0 and the end is the final sample. Some music has an intro that plays once, followed by a body that loops; in that case the loop start is placed after the intro.

Where the points live depends on the format:

FormatHow loop points are storedNotes
WAVAn smpl chunk with one or more loop entries (start and end in samples)Read natively by some engines and tools; others ignore it and loop the whole file
OGG VorbisUsually custom comment tags or none at allSupport varies by engine and middleware; encoder padding can add small offsets
MP3Not reliable for gapless loopsEncoder delay and padding make sample-accurate looping hard
Engine-sideYou set loop start and end in the import settings or codeWorks with any format, and is the most portable approach

The practical advice: use WAV for music that must loop perfectly, and if you use a compressed format, test the seam in the engine you ship on. Lossy codecs often add a few thousand samples of padding at the start, which can be audible if the engine does not compensate.

Mowjera exports a loop-matched WAV for each state, with an smpl loop chunk written into the file, and optionally OGG Vorbis. Unreal needs WAV, so the WAV export is the one to use there.

How do I loop sample-accurately in my engine?

Sample-accurate looping means the audio hardware's playback position wraps back to the loop start without the engine stopping and restarting the sound. Every major engine supports it, but it is often off by default.

Whatever the engine, never implement a loop as "when the track ends, call play again." That introduces exactly the gap you are trying to remove.

How do I keep loops seamless when I switch between states?

Switching between two looping states adds a second problem: both must be the same length in bars, or the engine must switch only at a boundary both can honor. If your Explore loop is 8 bars and your Combat loop is 8 bars at the same tempo, the engine can start Combat on bar one of the next pass and it will be in time. See states and transitions for how to schedule that.

Loudness is the other surprise. If Combat is several decibels louder than Explore, the switch will feel jarring even if the timing is perfect. Match perceived loudness across states during mixing. Mowjera applies loop-matched loudness across states on export so you do not have to do that by hand, but whatever tool you use, compare states back to back at the same monitoring level.

How do I test a loop before shipping it?

  1. Select a region of two to three seconds centered on the seam and loop only that region in your DAW or editor.
  2. Listen on headphones for clicks, volume dips and a change in room sound.
  3. Zoom in on the waveform at the seam and check there is no obvious jump in level.
  4. Play the file in the actual engine for at least five minutes and listen for a periodic gap.
  5. Play it at a different sample rate if your game supports several, since resampling can shift the end by a sample.

FAQ

Why does my game music loop have a gap at the end?

Usually the exported file contains silence or a cut reverb tail at the end, or the engine restarts the sound instead of wrapping the playback position. Fix the file by trimming to an exact bar length with the tail folded onto the start, and enable true looping in the engine.

What is a WAV smpl chunk?

The smpl chunk is an optional block inside a WAV file that stores sampler metadata, including loop start and end positions in samples. Some engines and tools read it to set loop points automatically. Others ignore it, so you should confirm your engine honors it or set the loop points manually.

Is OGG or WAV better for looping game music?

WAV is the safest for sample-accurate loops because it is uncompressed and has no encoder padding. OGG Vorbis is much smaller and works well in many engines, but you should test the seam in your target engine. Many teams use WAV for short loops and OGG for long ones.

How long should a game music loop be?

There is no fixed rule. Eight to sixteen bars is a common range, which at moderate tempos is roughly fifteen to forty seconds. Longer loops reduce repetition fatigue for music players hear for a long time, while shorter loops suit menus, stingers and transitional states.

Can I make a loop seamless in an existing audio file?

Often yes. Find a cut point on a bar line, trim the file to a whole number of bars, copy the tail that sits past the loop end onto the beginning, and verify the seam. If the original was a fully mixed render without extra tail, you may need to re-export from the project.

Where to go from here

If you export from Mowjera you get this handled per state: looping WAV with an smpl chunk, loudness matched across states. You can try the editor with no account at /try. For the bigger picture of how looping music fits an adaptive system, read the beginner's guide to adaptive music.

Share

Hear it instead of reading about it

Every score on the marketplace plays live in your browser — and the ✨ AI composer drafts an adaptive score from one sentence.

Browse the marketplace

From the blog

More scores like this