•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 425,895 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,897 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 253 | Replies: 1
![]() |
•
•
Join Date: Apr 2008
Posts: 26
Reputation:
Rep Power: 1
Solved Threads: 0
Sorry to have to post two consecutive questions for other people to help me with, but I'm having a problem with winsound that I simply can't figure out. I've checked all the documentation I could, but there's no answer.
The problem is with SND_PURGE.
This is used in conjunction with PlaySound, which has the following entry:
Also, SND_FILENAME is needed, I believe, since I'm playing from a file.
--------------------
Alright, so here's a problem. Put simply, SND_PURGE appears to do nothing.
Yes, absolutely nothing, no matter how I present it.
Take the following code. It shouldn't do anything, right?
Well, that doesn't work. Take out the SND_FILENAME from the fourth line? Still doesn't work. Am I using this wrong? And if so, can someone propose an alternative? Thanks in advance.
The problem is with SND_PURGE.
•
•
•
•
Originally Posted by Python Library Reference
SND_PURGE
Stop playing all instances of the specified sound.
This is used in conjunction with PlaySound, which has the following entry:
•
•
•
•
PlaySound( sound, flags)
Call the underlying PlaySound() function from the Platform API. The sound parameter may be a filename, audio data as a string, or None. Its interpretation depends on the value of flags, which can be a bit-wise ORed combination of the constants described below. If the system indicates an error, RuntimeError is raised.
Also, SND_FILENAME is needed, I believe, since I'm playing from a file.
•
•
•
•
SND_FILENAME
The sound parameter is the name of a WAV file. Do not use with SND_ALIAS.
--------------------
Alright, so here's a problem. Put simply, SND_PURGE appears to do nothing.
Yes, absolutely nothing, no matter how I present it.
Take the following code. It shouldn't do anything, right?
Python Syntax (Toggle Plain Text)
from winsound import * PlaySound("testSound.wav",SND_FILENAME) # Play testSound.wav PlaySound("testSound.wav",SND_FILENAME|SND_PURGE) # Stop playing testSound.wav
Well, that doesn't work. Take out the SND_FILENAME from the fourth line? Still doesn't work. Am I using this wrong? And if so, can someone propose an alternative? Thanks in advance.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Python Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
age amd avatar blue gene business chips database development dos economy energy enterprise environment hardware ibm ibm. news intel ibm it linux medicine memory microsoft news office open source openoffice pc ps3 recession red hat remote working russia security sex sun supercomputer supercomputing technology trends ubuntu working x86
- Previous Thread: My 10 line calculator, I want it to display decimals when the equation calls for it.
- Next Thread: Regarding split()



Linear Mode