Ogg audio does not loop despite having the loop flag set

Godot Version

v4.2.1.stable.official [b09f793f5]

Question

Heyo, folks! Been trying to build our first game with Godot and one seemingly minor but annoying snag we’ve encountered relates to .ogg audio files and looping.

I’ve created an AudioStreamPlayer2D and assigned it to a 2D node in the playable space. It plays audio fine and works as expected. I have then reimported my .ogg audio file with the Loop flag set to true. The Loop flag is also displayed as true in the AudioStreamPlayer2D’s stream properties. However, the audio refuses to loop and simply falls silent at the end of its first run.

Apart from creating a signal and listener function combo to force the audio to restart every time it runs out, are there any suggestions on how to troubleshoot this issue?

I remember having a similar problem a few months ago. I have no idea what the cause was, but I ended up solving it by using ogg for sounds that don’t repeat and mp3 for music that needs to play in a loop. The patent on the mp3 format expired seven years ago, so there shouldn’t be any problem with it.

Many thanks! I tried this and it does seem to have worked fine. Only reason I was using .ogg was for uniformity, so all my assets are of the same type, but this is not a big deal. At least my cozy fireplace now crackles on without issue!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.