Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win Api Beep()

Status
Not open for further replies.

ashthud

Programmer
Oct 6, 2008
53
0
0
GB
This is a simple, but probably very difficult-to-answer, question.

When you get an error message in windows... lets say you typed "blah" into the 'run' dialog, you will hear a nice PC beep.

When *i* try to make a BEEP it sounds WRONG! What frequency is windows using for their error message BEEPS?

Ashthud
 
Or for a little more variety in the sound you can play, try PlaySound function.
 
Or plain Beep ...

'vb6
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long

Private Sub Command1_Click()

sound 37, 100

End Sub

Private Sub sound(hz, duration)

Beep hz, duration

End Sub
 
=beep(442,100) is the very similar, if not, the default system beep. Thanks to a few colleagues of mine, one who has a very enthusiastic interest in music.

Ashthud
 
MessageBeep(-1) should use the correct default beep, and will even use the PC speaker to do the beep if no soundcard installed/detected
 
HA! You're correct! I have no speakers but there are drivers installed for the speakers... so i being played but through non-existant speakers. CHEERS

Ashthud
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top