Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Beep API
Message
 
To
08/12/2005 15:39:52
General information
Forum:
Windows
Category:
API
Title:
Miscellaneous
Thread ID:
01074931
Message ID:
01076410
Views:
23
Claudio,

It started out like this:

I have a program. Just any program. When I do something, I want something to get my attention. So I say
SET BELL ON
SET BELL TO 'blip.wav'
? CHR(7)
But that seemed clumsy. Same old blip sound. Maybe you don't notice it. Maybe it didn't get your attention.

I thought about Morse code. Maybe you don't know Morse code, but you hear it, and it gets your attention! You think, what is heck THAT?

AH HA

I used to use Morse code in military and on ham radio, so I know "dah" sound = 2 to 3 times the duration of "dit." The frequency of the sound is the same, but your brain hears a longer sound and you PERCEIVE it to be lower tone, but it's not. Spacing inside a character is the same as "dit" duration.

For example, when I do a Fox function, I want to know, did it return a value? I can examine the variable manually to determine if it contains a value, or I can use audible prompts inside the program. I hear it and I know it workded ... no wait window or message box. And everybody looks to see, what is that?
* return the DOS short path name for a file in _cliptext
DECLARE INTEGER GetShortPathName IN kernel32.DLL ;
   STRING lpszLongPath, STRING @lpszShortPath, INTEGER BufferLen
DECLARE INTEGER Beep IN kernel32 INTEGER dwFreq, INTEGER dwDuration
DECLARE Sleep IN kernel32 LONG dwMilliseconds
LOCAL lpszLongPath, lpszShortPath, BufferLen, retval
STORE REPLICATE(CHR(0),256) TO lpszShortPath
STORE LEN(lpszShortPath) TO BufferLen
STORE GETFILE() + CHR(0) TO lpszLongPath
retval = GetShortPathName(lpszLongPath, @lpszShortPath, BufferLen)
IF retval # 0
   _CLIPTEXT = SUBSTR( lpszShortPath, 1, retval )
   Beep(800,40)   && play a morse "v"
   Sleep(40)
   Beep(800,40)
   Sleep(40)
   Beep(800,40)
   Sleep(40)
   Beep(800,100)
ENDIF
The only problem is that the Beep API in Win9x doesn't work. I found some info about using assembler in Delphi to directly access the programmable timer at port 43H which connects to the pc speaker. It will not work in XP but I don't need it in XP, I only need it in Win 9x anyway! Maybe assembler is too much, maybe I can do it in C and make a DLL.

I just think it would be neat.

...Art
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform