Wednesday 31 August 2011

Beep Function


This shows you how to set the frequency & duration of a beep sound. Put this in your *.bas file1:53 AM 8/19/2007:

Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Put something like this in a button:
Dim ret As Long
ret = Beep(1500, 300)
Or, if you want to do something a little more fun, try this:
Dim ret As Long, i As Integer

For i = 0 To 4000 Step 100
    ret = Beep(i, 100)
Next

No comments:

Post a Comment

Blogger Widgets Twitter Bird Gadget