This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: winsound.SND_PURGE has no effect
Type: behavior Stage:
Components: Extension Modules Versions: Python 2.6
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Ultrasick, georg.brandl, ocean-city
Priority: normal Keywords:

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:43adminsetgithub: 48991
2008-12-26 09:36:48georg.brandlsetstatus: open -> closed
resolution: wont fix
messages: + msg78290
nosy: + georg.brandl
2008-12-24 23:14:44ocean-citysetnosy: + ocean-city
messages: + msg78274
2008-12-24 20:43:50Ultrasicksetfiles: + sound.wav
messages: + msg78271
2008-12-24 20:43:18Ultrasickcreate