Results 1 to 2 of 2

Thread: this reg alarm. urgent

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Secunderabad, AP, INDIA
    Posts
    20

    Post

    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

  2. #2
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    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.
    Micah Carrick
    Visual Basic 6 SP5
    Visual Basic.NET
    Quixotix Software
    [email protected]
    Download QCM 1.0 - Intelligent ActiveX Control Management

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width