0 votes

I have added a OGG kind sound in my game. It will play once when user Tap on mobile screen. But the problem is OGG sound gets looped.

Here is the code to play the sound

$AudioStreamPlayer2D.playing = true

How to avoid looping. I want the sound to be played once.

in Projects by (104 points)

2 Answers

+3 votes
Best answer

You probably imported the sound with Loop turned on. To fix it..

  • Select the sound file in the FileSystem tab in Godot
  • Go to the Import tab (next to the Scene tab)
  • Uncheck Loop
  • Click the Reimport button
by (10,836 points)
selected by

Exactly what am looking for

Woow thank you

+2 votes

In the file system window where you usually get a view of all your files, you just have to select the .ogg file and then go above to the Scene View. On it's right you will see import Tab. Click on it and then there will be many options, uncheck the Loop and click on Reimport. This should fix your problem.

by (359 points)

Exactly what am looking for

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.

Categories