It would appear at first that VB's standard Beep function would do just this. However, if a sound card is installed, even if the speakers are turned off, they will be used instead. To force the PC's internal speaker to sound, you need to use the Windows API beep function. Using this, you can even set the pitch and length of the beep.
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal
dwDuration As Long) As Long
To sound the beeper, simply use
Beep 500, 1000
The first value sets the frequency (or pitch). I find my PC's beeper performs best in the 500-3000 range. The second value is the duration of the beep in milliseconds (so 1000 is one second).
Comments