I added a .py file to demonstrate the problem. I tryed 2 ways to stop the sound from beeing played. The first way "winsound.PlaySound(path[0] + '/sound.wav', winsound.SND_PURGE)" should already stop it but instead it starts the playback again. The second has no effect on my computer. My system: Windows 2000, service pack: 4 Python 2.6.something
You should specify winsound.SND_ASYNC in first PlaySound. By default, PlaySound won't return until completing to play wav file. winsound.SND_PURGE doesn't work for me. I'm also using Win2000SP4, and I found http://www.vbforums.com/archive/index.php/t-209162.html They also think SND_PURGE doesn't work on Win2000. And MSDN says SND_PURGE is not supported. (http://msdn.microsoft.com/en- us/library/ms712879.aspx)