0 votes

I have created a global script for my background audio and it contains only this code :

extends AudioStreamPlayer

func _ready() -> void:
    stream = load("res://Sounds/Soltitude.wav")
    playing = true

Now when I launch the game audio plays just fine but then it stops for some reason after some time. I selected the loop option while importing audio but I don't know where things are going wrong

in Engine by (403 points)

Do you mean it stops in the middle, or does it stop at the end of the file, as if it had no loop?

Note: you don't need pass

It stops in the end as if it has no loop !

Oh I fixed it ! I feel so embarrassed. I forgot to reimport the audio track while checking the loop option.

Hey! it would be nice if you add the answer you found as an answer, so the question does not remain unanswered

1 Answer

0 votes
Best answer

The reason I was unable to play my audio on loop was because I forgot to reimport the audio file after selecting the loop option. This made the loop end as well as the beginning 0. Simply reimporting the file fixed the issue.

by (403 points)

Yeah, after your first comment I was about to tell you that ;)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.