beep again

Tim Peters tim.one at home.com
Wed Jan 24 16:38:26 EST 2001


[clickron at webtv.net]
> Thanks for answering my last question. I get the beep now, but no
> matter what numbers I put in for the frequency and duration it doesn't
> change.

[Mark Hammond]
> The Python test suite has the following:
>
> import winsound
> for i in range(100, 2000, 100):
>     winsound.Beep(i, 75)
> print "Hopefully you heard some sounds increasing in frequency!"
>
>
> This does the "right thing" on both Python 2.0 and 2.1a1

LOL!  I never noticed that.  Of course, when you *run* the test suite via
regrtest.py, stdout is captured and merely compared against the canned
"expected stdout" file:

C:\Code\python\dist\src\PCbuild>type ..\lib\test\output\test_winsound
test_winsound
Hopefully you heard some sounds increasing in frequency!

C:\Code\python\dist\src\PCbuild>

So I never saw the msg before.  As a matter of fact, I don't *hear* anything
except a single "ding" when I run test_winsound.  If I stick a
time.sleep(.5) in the test_winsound loop, at least I hear multiple dings,
but they're all the same.

Don't have more time for this now.  Win98SE.  I'm pretty sure the "ding" I
hear is the registered Windows "Default Sound" (ding.wav, on my box) ...
yup!  If I change the Default Sound setting while test_winsound is running,
test_winsound starts playing the new .wav file instead.

May be significant that my box doesn't have an internal speaker --
everything is pumped out to external speakers.





More information about the Python-list mailing list