Results 1 to 7 of 7

Thread: Timer Alarm

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    15

    Question Timer Alarm

    im having trouble gettin a wav fiile to play heres my code
    i uploaded the vbp files
    VB 6 Code:
    1. Private Sub Command1_Click()
    2. Timer1.Enabled = True
    3. End Sub
    4.  
    5. Private Sub Command2_Click()
    6. Timer1.Enabled = False
    7. End Sub
    8.  
    9. Private Sub Command3_Click()
    10. Dim timer
    11. timer = Text4
    12. Open App.Path & "\" + timer + ".txt" For Output As #1
    13. Write #1,
    14. Close #1
    15.  
    16. End Sub
    17.  
    18. Private Sub Command4_Click()
    19. If alarm1.Text = Text1.Text And alarm2.Text = Text2.Text And alarm3.Text = Text3.Text Then play.Enabled = True
    20.  
    21. End Sub
    22.  
    23. Private Sub Command5_Click()
    24. play.URL = Text6.Text
    25. End Sub
    26.  
    27. Private Sub Form_Load()
    28.  
    29. End Sub
    30.  
    31. Private Sub Timer1_Timer()
    32. Text3.Text = Text3.Text + 1
    33. If Text3.Text = 60 Then
    34. Text2.Text = Text2.Text + 1
    35. Text3.Text = 0
    36. If Text2.Text = 60 Then
    37. Text1.Text = Text1.Text + 1
    38. Text2.Text = 0
    39. If alarm1.Text = Text1.Text And alarm2.Text = Text2.Text And alarm3.Text = Text3.Text Then play.Enabled = True
    40. End If
    41. End If
    42.  
    43. End Sub
    44.  
    45. Private Sub WindowsMediaPlayer1_OpenStateChange(ByVal NewState As Long)
    46.  
    47. End Sub
    Attached Files Attached Files
    Last edited by acms; Jul 9th, 2008 at 09:31 AM. Reason: blue code lol

  2. #2
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: Timer Alarm

    i havent looked through your code but if the problem is just with playing the file and you dont need to seek the wav file or anything later you can use this method:

    http://www.freevbcode.com/ShowCode.asp?ID=19

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Timer Alarm

    Define "trouble" - what is happening that shouldn't happen (or what is not happening that should)?

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    15

    Re: Timer Alarm

    Quote Originally Posted by Hack
    Define "trouble" - what is happening that shouldn't happen (or what is not happening that should)?
    the user can define the path of an alarm sound but when the alarm should go of it doesnt

  5. #5

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    15

    Re: Timer Alarm

    Quote Originally Posted by gavio
    What is "Play"? Is it a WindowsMediaPlayer Control?
    yes it is

  7. #7

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