-
hi friends!
pl help me how to make alarm.
actually the functionality is like this.
when a particular event occurs the alarm should make voice for first five seconds then it has to wait for five more seconds and then it has to make voice again, till it gets acknowledge by clicking other button.
pl help me how to proceed with this, i have used following function i am not understandin whats wrong with this..
Public Sub Warn(ByVal n As Integer)
Dim i As Integer
For i = 0 To n
Call sndPlaySound(ByVal "c:\my documents\wailingalarm.wav", SND_ASYNC)
Next i
pl correct it to get my functioanality please
..
bye reply asap
giridhar
End Sub
-
What you'd want to do, is have a timer that toggles the sound on and off at 5 sec intervals. To do this, call the sndPlaySound function with the loop flag to turn it on, then call it again with "" for the filename to turn it off.
For example, in the code that plays the sound, say TimerOn_Timer(),
lResult = sndPlaySound("c:\my documents\wailingalarm.wav", SND_ASYNC or SND_LOOP)
TimerOff.enabled = True
and then, after 5 seconds, in the TimerOff_Timer() event,
lResult = sndPlaySound("", SND_ASYNC)
TimerOn.enabled = true
P.S., It'd probably be better to just use on timer and toggle a value to determine whether to play or stop ... I used to just to make it easier.