zhujp98
09-09-2003, 08:31 AM
Private Sub Option1_Click()
Beep (1)
End Sub
Private Sub Option2_Click()
Beep (2)
End Sub
Private Sub Option3_Click()
Beep (3)
End Sub
Private Sub Option4_Click()
Beep (20)
End Sub
When the radio buttons are clicked, I want to hear differnt beeps
what this code does work?
passel
09-09-2003, 08:36 AM
Beep just produces a standard beep to the speaker, you can't control it
using the VB Beep, you need to use the API Beep. Press the blue
search button at the top right, and search for Beep. You will find an
example or two.
passel
09-09-2003, 08:43 AM
In particular, check out this thread which as an example that you can
download, that has two songs in it (although the example is only set up
to play one of them)
http://www.visualbasicforum.com/showthread.php?t=96088
manavo
09-09-2003, 07:03 PM
Here is an example of the Beep API :
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Form_Activate()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Cnt As Long
For Cnt = 0 To 5000 Step 10
'play a tone of 'Cnt' hertz, for 50 milliseconds
Beep Cnt, 50
Me.Caption = Cnt
DoEvents
Next Cnt
End Sub
OnErr0r
09-09-2003, 08:19 PM
I posted an ASM dll on the forum that will allow you to play tones on Win9x too. You should call GetVersionEx and only use it on 9X, as 2K+ doesn't like one of the instructiions. As mentioned, Beep API works fine on 2K+ anyway.
http://www.visualbasicforum.com/showpost.php?postid=182632
zhujp98
09-10-2003, 05:32 AM
Here is an example of the Beep API :
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Form_Activate()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
Dim Cnt As Long
For Cnt = 0 To 5000 Step 10
'play a tone of 'Cnt' hertz, for 50 milliseconds
Beep Cnt, 50
Me.Caption = Cnt
DoEvents
Next Cnt
End Sub
cool,thanks