1/6/2023 0 Comments Loop audio after effectsThen just set up the finished signal code to do what you need when the sound finishes (in my case loading the next scene after finishing the shop keepers dialog and animations - either canceling or opening the shop menu). Simply cast the stream resource as the class AudioStreamOGGVorbis and then you have access to the set_loop function. I imported it with looping (the default) and during the game I did want it to loop repeatedly in the scene it was playing in (an animated shop dialog scene), but after the dialog ended, I didn't want the loop to end abruptly with the stop function call and when the audio is looping it won't trigger the finished() signal, so how could I get access to stop looping (after the animation and dialog finished), but let the sound play to completion first? After scrubbing the internet I found no answers, but trying a bunch of things, I finally found a simple two line solution: var strm = $Music.stream as AudioStreamOGGVorbis I had an AudioStreamPlayer2D node with an imported OGG Vorbis resource. I know this is an old post, but I needed help with a very similar issue.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |