Closed DorusvdLinden closed 1 month ago
Thanks for opening this issue! There were some challenges with getting loops to behave "MPF style" in GMC, and I set that work aside to finish out other features. I've been thinking on it and your notes here have given me an idea on how to implement loops in a better way, so I'll keep you updated with how it goes!
Thank you @avanwinkle, for the update. Loops: 3 works now on AudioStreamRandomizer. Loops: -1 gives an error:
Not sure if AudioStreamRandomizer supports "self.stream.loop=true"
would it be an option to use the same approach as in _on_loop until overwritten by a state change?
PS: my machine configuration is on: https://github.com/DorusvdLinden/PortalPinball-V4.0
That's a curious error, because AudioStreamRandomizer inherits from AudioStream, as do AudioStreamOggVorbis and AudioStreamMP3, but the randomizer does not inherit from either of those so it shouldn't be entering this code block if self.stream
is a randomizer.
There's an argument to be made for always doing the manual looping instead of relying on the Ogg/MP3/Wav built-in method, but I'll investigate a little more first.
Okay, my bad. I had a shorthand in the condition that was always returning true and trying to treat the resource as an Ogg/Wav. Fixed that and verified that AudioStreamRandomizer now can loop indefinitely.
Great to hear. I will test it in the weekend. Thank you for the fast response. Ps: I really like the new setup.
Thank you so much, the loop: -1 now also works. Great to see how fast this evolves.
Dear all,
I love the new setup, but i have one issue: In my previous iteration I was looping multiple sounds in attract mode randomly, to create a dynamic background.
Now in Godot, the individual wav files can loop, but the audiostreamrandomiser stops after 1 sound played.
Using loops: -1, 3 or true gives an error in the MPF.Media.Sounds code (GMCChannel.gd) in mpf-gmc/scripts/)
code:
without the loops it runs fine. Could be my mistake. Kind regards Dorus