Issue 4741: winsound.SND_PURGE has no effect (original) (raw)

Issue4741

Created on 2008-12-24 20:43 by Ultrasick, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test.py Ultrasick,2008-12-24 20:43 demonstration test file: test.py
sound.wav Ultrasick,2008-12-24 20:43 demonstration test sound: sound.wav
Messages (4)
msg78270 - (view) Author: (Ultrasick) Date: 2008-12-24 20:43
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
msg78271 - (view) Author: (Ultrasick) Date: 2008-12-24 20:43
added a test sound
msg78274 - (view) Author: Hirokazu Yamamoto (ocean-city) * (Python committer) Date: 2008-12-24 23:14
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)
msg78290 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-12-26 09:36
In any case, this is not an issue in Python as PlaySound is only a thin wrapper around the OS' function.
History
Date User Action Args
2022-04-11 14:56:43 admin set github: 48991
2008-12-26 09:36:48 georg.brandl set status: open -> closedresolution: wont fixmessages: + nosy: + georg.brandl
2008-12-24 23:14:44 ocean-city set nosy: + ocean-citymessages: +
2008-12-24 20:43:50 Ultrasick set files: + sound.wavmessages: +
2008-12-24 20:43:18 Ultrasick create