So, as long as your Global.M3GA10VAN1A
variable is true, your code will start the AudioStreamPlayer
on each frame. And, calling play()
starts the audio from its beginning. So, you're effectively restarting the audio every frame, as long as that variable is true.
Since you didn't specify what that variable does, or how it's controlled, it's hard to be specific about advice. That said, maybe all you want to do is play the audio if your variable is true and the audio isn't already playing. If that's the case, then this should work:
if Global.M3GA10VAN1A && !self.playing:
self.play()