how can you make a computer beep?
Printable View
how can you make a computer beep?
VB Code:
Beep
You have a choice between using the VB built in function Beep that will beep through your soundcard (if you have one) or use the API Beep function that will send the signal through the computer speaker, no matter if you have a sound card or not (or if you have a speaker connected to your sound card).
I liked the ol' QBasic Beep - where you could give it duration, and frequency, and iterations or something.
Making multiple beeps in VB6 is a pain in the arse... :(
The API function will allow you to do so.Quote:
Originally posted by rjlohan
I liked the ol' QBasic Beep - where you could give it duration, and frequency, and iterations or something.
Making multiple beeps in VB6 is a pain in the arse... :(
Best regardsVB Code:
Private Declare Function BeepAPI _ Lib "kernel32" Alias "Beep" ( _ ByVal dwFreq As Long, _ ByVal dwDuration As Long) As Long
Groovy baby, yeah!
:D
The beep API has absolutely no effect when i run it. I don't seem to know why. I want to make beep songs like in qbasic...
The dwFreq and dwDuration arguments are ignored on Win9x based systems I'm affraid.Quote:
Originally posted by nishantp
The beep API has absolutely no effect when i run it. I don't seem to know why. I want to make beep songs like in qbasic...
With systems with a sound card this function will play the default system beep on Win9x.
I'm running XP, which is NT based...I don't understand why it doesnt work. Is there a volume setting for the computer speaker?
I tried the following code on my XP computer without problems:Quote:
Originally posted by nishantp
I'm running XP, which is NT based...I don't understand why it doesnt work. Is there a volume setting for the computer speaker?
VB Code:
Private Declare Function BeepAPI _ Lib "kernel32" Alias "Beep" ( _ ByVal dwFreq As Long, _ ByVal dwDuration As Long) As Long Private Sub Command1_Click() BeepAPI 200, 1000 End Sub
I just tried that and some variations. It seems theres something physically wrong with by speaker. Thanks anyways.:(
:)