I want to loop the sound with winsound but it doesn't work with
winsound.PlaySound(song[0], winsound.SND_ASYNC + winsound.SND_LOOP
and
winsound.PlaySound(song[0], winsound.SND_FILENAME | winsound.SND_ASYNC + winsound.SND_LOOP
The code just closes after this. What's the problem?
To use SND_LOOP, you have to use SND_ASYNC, and that means the sound is playing in a separate thread. The
PlaySoundfunction will return immediately. Your code is presumably going to do something else while the sound plays. If nothing else, dotime.sleep(5)in a loop.