Results 1 to 11 of 11

Thread: Need an alarm to override games sounds (Solved)

Hybrid View

  1. #1

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Cool

    Ok, got it.

    Started with frmMain and for testing, added two command buttons to it.
    Added "Project/ Components/ Windows Media Player" to the tool bar,
    then added Mediaplayer to a 2nd form - frmSound.
    And then put this code in the respective forms.
    -------------
    ' in frmMain
    Private Sub cmdPlay_Click()
         Load frmSound
        frmSound.Play ("My.wav")' You'll need to add the path if your .wav isn't in the same folder as the program
    End Sub

    Private Sub cmdStop_Click()
        frmSound.MediaPlayer1.Stop
        Unload frmSound
    End Sub

    ---------
    'in frmSound
    Public Sub Play(filename)
    On Error Resume Next
    &nbsp;&nbsp;&nbsp;&nbsp;If filename <> "" Then
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;With MediaPlayer1
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.AutoStart = True
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.filename = filename
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Play
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End With
    &nbsp;&nbsp;&nbsp;&nbsp;End If
    End Sub
    ---------
    It feels like playing "Mary Had a little Lamb" on a pipe organ, but it WORKS!
    I wonder how many ppl have writen alarms that can play DVDs on the side : )
    But it will play over a game.
    Thanks for all your help guys!
    Last edited by longwolf; Oct 27th, 2002 at 07:05 AM.

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