A short guide for anyone bringing original music into Godot and wondering why every looping answer starts with two AudioStreamPlayers and a script.
Search for “godot loop music” and the answers all have the same shape. Turn on Loop in the Import dock, and accept that the whole file repeats. Or split your track into an intro file and a loop file, and write a script that plays one after the other. Or set up two AudioStreamPlayers and swap between them with code.
Every one of those is a workaround for a feature Godot already has.
If your WAV has loop points written into it, Godot reads them on import and loops between them. Automatically, sample-exact, with no code and no settings to change.
Drop the file in. That is the whole tutorial.
What Godot actually does
WAV files have a standard slot for loop points called the smpl chunk. It has been part of the format since the hardware sampler days, and it holds two numbers: the sample where the loop starts and the sample where it ends.
Godot’s WAV importer reads it. The engine’s own documentation says loop information “is automatically read from the WAV metadata on import,” and that wording has been in the Godot 4 docs all along. Current releases put it right in the Import dock: select a WAV and Loop Mode sits on Detect From WAV, as the default.
The two numbers are samples, so the wrap is sample-exact. And if the loop start is not zero, you get the good version of looping for free: Godot plays the file from the top once, your intro, then loops the body forever. One file, one plain AudioStreamPlayer, nothing to maintain.
The dropdown that can undo it
Loop Mode has four other settings, and one of them is a trap precisely because it sounds correct.
Disabled is honest: it ignores the file’s loop points and plays the track once. At least it does what it says.
Forward is the trap. Standard forward looping is exactly what you want, so it reads like the right choice. But choosing Forward (or Ping-Pong, or Backward) tells the importer to stop listening to the file and use the dock’s own Loop Begin and Loop End instead, and those default to zero and end-of-file. Your carefully placed loop points are gone and the whole file loops, reverb tail and all, which lands you straight in the classic seam bug: the tail rings out to silence and the music jumps cold back to the top. Nothing in the dock warns you that the file’s own markers just got dropped.
So the fix is the absence of a fix. Leave Loop Mode on Detect From WAV. If a project shows something else there, set it back and press Reimport.
OGG is where it falls apart
Godot’s OGG import offers a Loop checkbox and a Loop Offset in seconds, typed by hand. That is a loop begin. There is no loop end. And Godot does not read LOOPSTART or LOOPLENGTH tags from an OGG’s comments, the same two tags RPG Maker reads; I checked the current engine source before writing that sentence, because plenty of pages claim otherwise. MP3 import is the same story.
That means an OGG loop in Godot only works when the file itself is the loop body: it has to end exactly where the loop ends, with nothing after it. Then Loop plus a hand-typed offset gives you intro-then-body, within whatever precision you typed.
WAV is the only format where both numbers travel inside the file, sample-accurate, and get read automatically. If you want the native loop, feed Godot WAV.
The one thing the native loop cannot do
The native loop is one playhead. When it reaches the loop end it jumps back to the loop start, which also means whatever audio sits after the loop end never plays. If your music has a reverb or delay tail ringing across the loop point, that tail gets cut off at the wrap, every pass. I wrote about why that happens, and it is not Godot being cheap: every single-voice native loop in every engine has the same blind spot.
There are two honest fixes. One is to fold the tail into the head before export, so the ring-out is baked into the start of the file and the plain native loop stays seamless. The other is a second voice: a script that lets the tail ring while a new voice takes the loop from the top. One limit if you go the script route: GDScript has no sample-accurate scheduled start, no equivalent of Unity’s PlayScheduled, so a two-voice script lands the seam within a few milliseconds rather than exactly. A ringing tail hides that completely. For a dry, rhythmic loop, skip the script: the native marker loop is the sample-exact path.
If you end up writing loop code anyway
One gotcha from testing generated Godot players this month: if your game pauses with Engine.time_scale = 0, delta stops advancing but the audio keeps playing. Any fade you step with delta freezes mid-fade, so a stop fade hangs the music at half volume for as long as the pause lasts. Time fades on an unscaled clock instead, Time.get_ticks_usec(), and they finish no matter what the game clock is doing. I hit this with Loopsmith’s own generated scripts, and they all time their stop fades on the wall clock now.
Try it on your own track
Render one piece of your music with its natural ring-out on the end. Get the loop start and loop end into the WAV’s smpl chunk, drop it into a Godot project, press play, and listen to it come back around.
The part that wears on you is everything before the drop: finding the exact samples where the loop breathes right, hearing the seam repeat before you commit, catching the click or the loudness jump sitting on the wrap, folding the tail when the track needs it, and doing it all again when the music gets revised. That is the part Loopsmith takes off you. It finds the loop point, plays you the seam, flags what is wrong with it, and writes the WAV with the smpl chunk filled in correctly, plus the two-voice GDScript when you want the tail-overlap version instead. The demo is the full app with five free exports, which is enough to hear one of your own tracks looping inside your own Godot project tonight. It is Windows, and it costs nothing to find out.
If you also work in Unity: it reads the very same smpl chunk, but its default import settings are what break them. The full map of which engine reads what is in How Game Engines Handle Loop Points in Audio Files.
Austin Haynes is a composer for games, including Cognition: An Erica Reed Thriller (AdventureGamers Best Music of 2013) and The Silver Lining. If your project needs music, you can hear his work at austinhaynesmusic.com.