Looping audio fails silently in Godot: the file may be perfectly seamless, but the importer decides whether it loops. Here is what I found when I tested some files, plus a short script so you can check your own.
What I tested (Godot 4.7.2 stable, headless, 27 October 2026, default import settings unless stated):
- A 48 kHz / 24-bit stereo WAV with loop markers in the file (an `smpl` chunk) was imported as a Forward loop automatically: `loop_mode = 1`, `loop_end = 2879999`, which is exactly 60 s x 48000 minus 1. The same happened with a second 60 s file.
- A one-shot WAV imported with `loop_mode = 0`, as expected.
- A 44.1 kHz / 16-bit WAV with no loop markers imported with `loop_mode = 0`: it plays once, even though the audio itself loops cleanly. I started two players on it and on a looping file; the first one stopped at 42 s and the other kept going.
- After setting Edit > Loop Mode to Forward in the Import dock and reimporting, the same file read `loop_mode = 1`, `loop_begin = 0`, `loop_end = 1852199` (42 s x 44100 minus 1).
- The matching OGG imported with `loop = false`, `loop_offset = 0`; with Loop ticked it read `loop = true`.
- The default WAV compress mode in 4.7.2 is Quite OK Audio (QOA) according to the docs, and the loop points above still came through with it.
So the checklist:
1. Does the file carry loop markers? If not, set Loop Mode to Forward in the Import dock (WAV), or tick Loop (OGG), then press Reimport.
2. Print the result instead of guessing. Put this in a script and run it with `godot --headless -s probe.gd` from your project folder (change the file names):
extends SceneTree
func _init():
for f in ["rain_loop.wav", "knock_01.wav"]:
var s = load("res://audio/" + f) as AudioStreamWAV
print(f, " loop_mode=", s.loop_mode, " loop_begin=", s.loop_begin, " loop_end=", s.loop_end, " length_s=", s.get_length())
quit()3. If you hear a click at the loop point, compare the last and first sample values with the file's normal sample-to-sample steps. A jump bigger than 99% of the normal steps is the likely cause; fix it with a crossfade in your audio editor, not in the engine.
The Godot docs page on importing audio samples covers the same options (Loop Mode for WAV, Loop and Loop Offset for OGG and MP3): https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/importing_audio_samples.html
Question for everyone: have you hit a case where a loop worked in the editor but not in an exported build, or the other way around? I haven't, and I'd like to know what to add to the checklist.
— yetiancai