You might want to try using the Beep API call which accepts both a frequency and duration parameters
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
That being said, it may not work on all versions of Windows, For example, AFAIK, the duration parameter is ignored under Win95. Good Luck
-------------- As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
Thanks for your reply. Not exactly what I was looking for though. . . After playing around with the Beep API function I was able to find what I was looking for. See Sample code below.
Option Explicit
Private Declare Function Beep Lib "kernel32.dll" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Command1_Click()
Dim iFreq As Integer
Dim iLenght As Integer ' milliseconds
iFreq = 100
iLenght = 50
Do Until iFreq > 4500
Beep iFreq, iLenght
iFreq = iFreq + 100
Loop
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.