PC-Beeper

Blitz3D Forums/Blitz3D Programming/PC-Beeper

GrrBrr(Posted 2004) [#1]
Is there a possibility to use the PC-Beeper with Blitz3D?


WolRon(Posted 2004) [#2]
Through API calls I suppose.


VIP3R(Posted 2004) [#3]
You need to do it with userlibs (API):

; ### Message Beep

.lib "user32.dll"
MessageBeep%(uType%):"MessageBeep"

Type parameters:

SPEAKER or DEFAULT = -1
MB_OK = 0 
MB_ICONHAND = 16
MB_ICONQUESTION = 32
MB_ICONEXCLAMATION = 48
MB_ICONASTERISK = 64

Example:
MessageBeep(128)

Or, for the classic speaker beep with variable frequency
and duration (only for NT/2000/XP), try this:

.lib "kernel32.dll"
Beep%(freq%, duration%):"Beep"

(frequency between $25 and $7fff)

(duration in millisecs)

Example:
Beep($7777, 2000)

This code was kindly provided by soja, so he deserves any credit for it.


GrrBrr(Posted 2004) [#4]
ah! this works perfectly for me. thanks a lot


GrrBrr(Posted 2004) [#5]
this solution works fine on my xp-system, but...

hmmm... does anyone know a possibility to beep with a variable frequency on a win98 machine? or does anyone know how to define the standard windows-signals to beep-singnals?

the user32-messagebeep is always a very short beep on my win98-machine.. its nearly unhearable... :(


GrrBrr(Posted 2004) [#6]
nobody knows a solution? :(