'Pygame.mixer.channel.play() Redefining arguments during play

I have found that, in my use case, the only way to change the LOOPS argument is to make it a variable, change the variable, then re-send the .play(). This has the undesired effect of restarting the sound from the beginning. I am trying to get a sound to loop infinitely, then on a trigger play to the end of the file and stop. I may be completely barking up the wrong tree, so if there is a better way to do it im all ears.

I have tried changing the variable and re-sending it. I have tried .pause() and unpause() but they dont cause the initial play command to re-read the variable. I have no idea what it is doing in the background to make this all happen.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source