LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,059
Default How to tell when Beep sound is done?

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you stop a Msgbox from making a beep sound? Thanks. kirkm[_9_] Excel Programming 0 July 4th 09 05:21 AM
Sound / Beep function from within VB or Excel VBA tomcee Excel Programming 3 October 17th 07 01:26 AM
Beep Change The Sound Bob Excel Discussion (Misc queries) 0 July 6th 06 11:56 PM
Beep or Make Sound after Calcing [email protected] Excel Programming 1 February 9th 05 12:53 AM
How BEEP on internal speakers, not on sound-card? Michel[_3_] Excel Programming 4 October 15th 03 12:51 PM


All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"