|
-
Oct 26th, 2002, 02:37 PM
#1
Thread Starter
Frenzied Member
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.
-
Oct 26th, 2002, 03:31 PM
#2
Lively Member
Hmm. Not really sure. Have you tried using Direct Sound?
-
Oct 26th, 2002, 10:51 PM
#3
Hyperactive Member
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]
-
Oct 26th, 2002, 11:00 PM
#4
I did a Google search for Alarm program and got several hits. This site seems to be a good one, and it's free.
-
Oct 26th, 2002, 11:25 PM
#5
Thread Starter
Frenzied Member
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.
-
Oct 26th, 2002, 11:43 PM
#6
what code are you using to play the sound?
are you using mci?
maybe if you embedded a mplayer control?
-
Oct 27th, 2002, 12:55 AM
#7
Hyperactive Member
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]
-
Oct 27th, 2002, 02:56 AM
#8
Thread Starter
Frenzied Member
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?
-
Oct 27th, 2002, 07:01 AM
#9
Thread Starter
Frenzied Member
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
If filename <> "" Then
With MediaPlayer1
.AutoStart = True
.filename = filename
.Play
End With
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.
-
Oct 27th, 2002, 07:08 AM
#10
Thread Starter
Frenzied Member
Ok, new prob,
How do I mark this a solved?
-
Oct 27th, 2002, 09:52 AM
#11
Edit your first post and change the title.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|