J
JoeU2004
On my computer (Intel-compatible with Win XP and VB 6.3, which I access
through Excel 2003), the Beep statement initiates the sound, then it returns
control before the sound is completed.
Is there any way in VB (probably using kernel APIs) to determine when the
sound is completed?
For example, if the Default Beep is set to Windows XP Startup.wav, the sound
takes about 2.75 sec on my computer.
Consequently, the following loop results in interrupting and restarting the
sound instead of playing the sound repeatedly after a delay of 500 msec
after the sound completes.
Public Declare Sub Sleep Lib "kernel32" (ByVal msec As Long)
Sub doit()
Dim i as Long
Beep
For i = 2 to 5
' want to wait for sound to complete here
' before sleeping
Sleep 500
Beep
Next i
End Sub
through Excel 2003), the Beep statement initiates the sound, then it returns
control before the sound is completed.
Is there any way in VB (probably using kernel APIs) to determine when the
sound is completed?
For example, if the Default Beep is set to Windows XP Startup.wav, the sound
takes about 2.75 sec on my computer.
Consequently, the following loop results in interrupting and restarting the
sound instead of playing the sound repeatedly after a delay of 500 msec
after the sound completes.
Public Declare Sub Sleep Lib "kernel32" (ByVal msec As Long)
Sub doit()
Dim i as Long
Beep
For i = 2 to 5
' want to wait for sound to complete here
' before sleeping
Sleep 500
Beep
Next i
End Sub