Currently working on a stupid/crazy project: Making an 8-Bit RPG top down game using only Turtle.
One of the problems I’m having is with background music. I use the winsound module and make sure all my sounds use the SND_ASYNC flag so that I can cut it off before it’s done if I need to.
I want to know if there’s a way to loop the sound while still keeping it async without it stopping the previous sound before it’s done, but still being able to cut off the sound and stop the loop if I need to.
I’ve tried a while loop, but since it stops the previous sound it just kept looping the first second.
I thought about combining the SND_NOWAIT flag with the SND_ASYNC flag, but I don’t know how I would do that.
And then I tried using the time module and doing time.sleep(120
to make it wait for the duration of the song (2 minutes) before playing it again, but that just stops the sound because it’s async.
FeralFoxProd is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.