How to avoid looping OGG sound?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By anbarasu chinna

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.

:bust_in_silhouette: Reply From: Scavex

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.

Exactly what am looking for

anbarasu chinna | 2020-09-13 14:21

:bust_in_silhouette: Reply From: jgodfrey

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

Exactly what am looking for

anbarasu chinna | 2020-09-13 14:20

Woow thank you

druce | 2021-04-01 00:31

Oh my gosh thank you so much. So simple!!! I owe you a coffee, jgodfrey.

CCLaw | 2022-01-29 02:04

Ohhhh my, thank yo sooooooo much hahahaha

piponazo19 | 2022-03-24 05:54