TaylorSMarks / playsound

Pure Python, cross platform, single function module with no dependencies for playing sounds.
Other
504 stars 118 forks source link

How to loop sounds? #109

Closed MEMESCOEP closed 1 week ago

MEMESCOEP commented 2 years ago

playsound version: 1.2.2

I have this segment of code (Running in a new thread):

pathtoaudio = AppDataPath + "\\lmao.mp3"
while True:   
     print("Playing Sound...")
     playsound(pathtoaudio, block=True)
     print("Done.")

This code should loop the audio, but it doesn't. The first print statement runs, but the second one doesn't print. Is this a bug?

bbbart commented 2 years ago

I don't know about 1.2.2, but with

victorwss commented 2 years ago

On windows, playsound doesn't work correctly. As far as I can tell, it works the first time you run it, but fails from the second time on.