Make your Delphi programs bleep like FractInt.
Control of PC Speaker in Windows.
Copyleft
Andy Preston, Apollo Developments, 1999.
andy@anorak.org.uk
This is Free Software,
released under the LGPL (Copy Enclosed).
OSI Certified
Open Source Software.
OSI Certified is a certification mark of the Open Source Initiative.
Delphi 1, 2, 3, and 4; C++ Builder 1, 3, and 4.
The specification of DoBleep (until version 4.5) was:
Procedure DoBleep (Freq : Word; MSecs : Integer);As of version 4.5 it is:
Procedure DoBleep (Freq : Word; MSecs : LongInt);This will only affect your 16-bit code (in 32-bit code an Integer is the same as a LongInt), and I don't think it will make a lot of difference to that either, but you have been warned.
Procedure FractintBeeps; Begin Bleep (bOK); Bleep (bInterrupt); Bleep (bError); End; Procedure PlayTune; { Play some nice tones of set duration } Begin { The people of Earth call it music. } DoBleep (146, 250); DoBleep (123, 250); DoBleep (164, 500); DoBleep (123, 500); End; Procedure HurtMe; { Play a nasty high pitched note } Begin { Don't stop until you're told to } DoBleep (1000, -1); End; Procedure MakeItStop; { Stop whatever sound is being produced } Begin ShutUp; End;
See Demo.dpr, Demo1.dfm, And Demo1.pas (included in this archive) for more information.
void __fastcall FractintBeeps { Bleep (bOK); Bleep (bInterrupt); Bleep (bError); } void __fastcall PlayTune { // Play some nice tones of set duration DoBleep (146, 250); DoBleep (123, 250); DoBleep (164, 500); DoBleep (123, 500); } void __fastcall HurtMe { // Play a nasty high pitched note. DoBleep (1000, -1); // Don't stop until you're told to } void __fastcall MakeItStop { // Stop whatever sound is being produced ShutUp(); }
See CBDemo.mak, CBDemo.cpp, CBDemo1.dfm, CBDemo1.cpp, And CBDemo1.h (included in this archive) for more information.
If there's a C++Builder dude out there who can remove all references to CDDemo.res from CBDemo.mak, please E-Mail me ( Andy Preston) so I can include your modified version
My customer needed a set of warning bleeps in his application, he didn't have a sound card (not much use in a kitchen!), and Windows' built-in (and rather sad) dit was no use at all.
I got hold of the TPCSpeaker component by Song Weng Sam from The DSP. But I thought a simple beeper was best implemented as a set of stand-alone procedures.
I was in the process of hacking TPCSpeaker into such a set of routines
when I came across an ancient copy of the FractInt source (Version 7.0
I think) which contained assembly source for the classic FractInt 'do-do-doop'.
So what we started with was a mixture of Song Weng Sam's delay loop, and a rather cut down version of FractInt's sound routines.
Since that time, many of you have added new facilities, and fixed bugs in BleepInt. The result is the only speaker driver you'll ever need.
If you've got any fab-and-groovy modifications for Bleepint, please E-Mail me ( Andy Preston).
FractInt, still the ultimate fractal generator, is a product of the Stone-Soup Group. I'm not sure which particular Stone-Souper was responsible for the bits I've filched, so I can't give hir the credit sHe deserves, I'll just take my hat off (except I don't wear a hat) to the lot of them.
Thanks to:
If you've tested it with Delphi 3, Delphi 4, C++ Builder, or on NT, please E-Mail me ( Andy Preston) and let me know. Then I can update this.
This page has been checked by Weblint, Version 1.020