Results 1 to 11 of 11

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

  1. #1

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

    Talking Need an alarm to override games sounds (Solved)

    I posted this last night, but it didn't seem to stick, so here goes again.

    Help!
    I've written a sub for my program with multiple alarms.
    The program sets the alarm times.
    It beeps or plays .wav's and works great.

    One problem, the subs' main reasons for existing it to tell me it's time to get out a whatever game the kids or I am playing and take care of biz!
    And, naturally, I'm not getting sound from it while a game is open.

    I've searched all over several web sites without luck.

    Is there some way (any way) to get the alarms to sound while in game play!
    I would prefer to use a wav file, but if another file type can do it Great!
    This app is important to me, the alarms are just part of a much bigger program that I'm using in a home biz.

    Please be gentle, I bought VB6 Pro some time back, haven't done much with it till now and the CD's are misplaced.
    So I don't have any help files, but I have installed sp5.

    Thx, John
    Last edited by longwolf; Oct 27th, 2002 at 01:33 PM.

  2. #2
    Lively Member FireSlash518's Avatar
    Join Date
    Nov 2001
    Posts
    67
    Hmm. Not really sure. Have you tried using Direct Sound?

    Leader of the Maxoverkill Mods
    -Fire§lash

  3. #3
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    Instead of playing a sound, try something else such as minimizing the game window or making the floopy drive attempt to read a disk which will make it "grind" (if it has no disk) or light up (if it does have a disk).
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  4. #4

  5. #5

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

    Another alarm program won't help me.
    My alarm sub links to a data base and sets the alarm to go off when I need to take care of something.
    I have no way of setting someone else's app to go off at those times because they're set dynamically.

    And making the floppy drive run probably won't get my attention if I'm in another room.

    I've downloaded and started playing with some DX-8 mixer scripts.
    They'll mix sounds in their own app, but stop playing as soon as the game window(Diablo II in this case) is raised.

    I guess I can have the alarm pop-up a small form when it sounds.
    That would lower the game window and let my app sound off.
    But that seems messy

    I'd still prefer a way to either take the sound cards focus away from the game, or mix my alarm in with the game sound.

  6. #6
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    what code are you using to play the sound?
    are you using mci?
    maybe if you embedded a mplayer control?
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  7. #7
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    You could maybe send keystrokes using SendMessage to the game to let you know that the alarm is going off. Or how about send the key for the numpad button '0' to make the character say, "Help!" if you're in a game when it goes off.

    I just thought of the perfect one, but it'll only work if you're in a game when the alarm goes off: send the strokes "soundchaosdebug" and the enter key to the game, that'll play a bunch of sounds all at once within the game, but nobody else will know.
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  8. #8

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

    Talking

    ROLF!
    I'm familiar with "soundchaosdebug" and that would be funny : D

    I downloaded a MPlayer script and it looks like it will do the trick!
    I can start playing a .wav, raise the game and still hear MPlayer running.
    Thanks for the tip Lord Orwell!

    I really don't understand exactly how to work it into my program (yup I'm a newbie)
    I'm stripping pieces away from the script I have.

    I'd like to get it down to:

    Public sub Play(Filename)
    yada
    yada
    end sub

    It'd be a big help if someone could show me how to do this in a few lines.
    I don't want to see MediaPlayer, just play the .wav.

    Also, will I need to add anything besides "MediaPlayer" from the toolbox?

  9. #9

    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.

  10. #10

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343
    Ok, new prob,
    How do I mark this a solved?

  11. #11

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