| View previous topic :: View next topic |
| Author |
Message |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 23, 2003 3:28 pm Post subject: PC Speaker Beep |
|
|
What API do I use to get a PC Speaker beep? I already tried MessageBeep
and Beep APIs.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Jul 23, 2003 5:49 pm Post subject: |
|
|
Well I was looking for a way to sound it through the internal PC Speaker...
I came up with this code :
| Code: | LOADLIB kernel32.dll
%A = @lib(kernel32,Beep,INT:,INT:2000,INT:100)
FREELIB kernel32.dll |
Thanks to all who helped anyway! _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Sun Jul 27, 2003 12:13 am Post subject: |
|
|
Of course this is identical to FreezingFire's good approach, though somewhat more
documented:
| Code: |
#define command,pcbeep
pcbeep 500,400
pcbeep 1000,500
pcbeep 1500,600
pcbeep 2000,700
pcbeep 2500,800
exit
:pcbeep
rem %1 = frequency (Hz; 37 up to 32767; only used on NT based operating systems)
rem %2 = duration (milliseconds; only used on NT based operating systems)
rem @ok() is set to false if insuccessful
loadlib kernel32.dll
%3 = @lib(kernel32.dll,Beep,bool:,int:%1,int:%2)
freelib kernel32.dll
if @zero(%3)
error -1
end
exit
|
|
|
| Back to top |
|
 |
|