Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista Tutorial - Is it possible to trap as an event when a certain sound plays, IE: Ding.wav

Reply
 
Old 07-02-2009   #1 (permalink)
Harold Little
Guest


 
 

Is it possible to trap as an event when a certain sound plays, IE: Ding.wav

Most will trap an event then play a sound file,
however I want to get notified by trapping when the Ding.wav is played ?



My System SpecsSystem Spec
Old 07-02-2009   #2 (permalink)
mayayana
Guest


 
 

Re: Is it possible to trap as an event when a certain sound plays, IE: Ding.wav

> Most will trap an event then play a sound file,
Quote:

> however I want to get notified by trapping when the Ding.wav is played ?
>
I c a n ' t t h i n k o f a n y t h i n g s h o r t
o f a s y s t e m - w i d e h o o k t h a t w a t c h e s
f o r a n y p r o c e s s o p e n i n g t h e . w a v
f i l e . T h a t ' s n o t a V B S - f r i e n d l y t a s k .
M a y b e i t w o u l d h e l p t o e x p l a i n w h a t
y o u ' r e t r y i n g t o a c c o m p l i s h .


My System SpecsSystem Spec
Old 07-02-2009   #3 (permalink)
Auric__
Guest


 
 

Re: Is it possible to trap as an event when a certain sound plays, IE: Ding.wav

On Thu, 02 Jul 2009 19:23:19 GMT, mayayana wrote:
Quote:
Quote:

>> Most will trap an event then play a sound file,
>> however I want to get notified by trapping when the Ding.wav is played ?
>
> I c a n ' t t h i n k o f a n y t h i n g s h o r t
> o f a s y s t e m - w i d e h o o k t h a t w a t c h e s
> f o r a n y p r o c e s s o p e n i n g t h e . w a v
> f i l e . T h a t ' s n o t a V B S - f r i e n d l y t a s k .
> M a y b e i t w o u l d h e l p t o e x p l a i n w h a t
> y o u ' r e t r y i n g t o a c c o m p l i s h .
Holy snapping crap! What happened?

--
To be a man, you must have honor, honor and a penis!
My System SpecsSystem Spec
Old 07-02-2009   #4 (permalink)
mayayana
Guest


 
 

Re: Is it possible to trap as an event when a certain sound plays, IE: Ding.wav

Quote:
Quote:
Quote:

> >> Most will trap an event then play a sound file,
> >> however I want to get notified by trapping when the Ding.wav is played
?
Quote:
Quote:

> >
> > I c a n ' t t h i n k o f a n y t h i n g s h o r t
> > o f a s y s t e m - w i d e h o o k t h a t w a t c h e s
> > f o r a n y p r o c e s s o p e n i n g t h e . w a v
> > f i l e . T h a t ' s n o t a V B S - f r i e n d l y t a s k
..
Quote:
Quote:

> > M a y b e i t w o u l d h e l p t o e x p l a i n w h a t
> > y o u ' r e t r y i n g t o a c c o m p l i s h .
>
> Holy snapping crap! What happened?
>
??

If you mean the weird spacing it's because my
first post got eaten by Microsoft's strange spam
filter. I can never figure out what sets it off, so
when it happens I just drop the text of my post
onto a little Desktop script that I keep for the
purpose. It inserts a space after every character.
The result is not as easy to read, but at least it
gets through.



My System SpecsSystem Spec
Old 07-02-2009   #5 (permalink)
Mark D. MacLachlan
Guest


 
 

Re: Is it possible to trap as an event when a certain sound plays, IE: Ding.wav

Harold, I believe you could do this with a WMI Event Consumer script.

Such a script is available in Ed Wilson's MSPRess book Windows
Scripting with WMI (Self Paced Learning Guide).

I attended a Microsoft sponsored workshop that was taught by the author
of this book. Important note: The author made the class aware that a
line was missing in the event consumer script in both the print and
companion CD versions.

To get the script to run, at the bottom of page 110 add the following
line of code.

objfilter.EventNameSpace = "root\cimv2"

Hope that helps,

Mark D. MacLachlan
My System SpecsSystem Spec
Old 07-03-2009   #6 (permalink)
hls
Guest


 
 

Re: Is it possible to trap as an event when a certain sound plays, IE: Ding.wav

Thanks, I will research the book.
When Ding wav plays it is Southwest alerting at my pc.
I want to trap and send a text to alert my cellphone.

"Harold Little" <harold.little@xxxxxx> wrote in message
news:OHXuhlx%23JHA.4560@xxxxxx
Quote:

> Most will trap an event then play a sound file,
> however I want to get notified by trapping when the Ding.wav is played ?
>
My System SpecsSystem Spec
Old 07-03-2009   #7 (permalink)
Mark D. MacLachlan
Guest


 
 

Re: Is it possible to trap as an event when a certain sound plays,

urkec wrote:
Quote:

> "Mark D. MacLachlan" wrote:
>
Quote:

> > Harold, I believe you could do this with a WMI Event Consumer
> > script.
> >
> > Such a script is available in Ed Wilson's MSPRess book Windows
> > Scripting with WMI (Self Paced Learning Guide).
> >
> > I attended a Microsoft sponsored workshop that was taught by the
> > author of this book. Important note: The author made the class
> > aware that a line was missing in the event consumer script in both
> > the print and companion CD versions.
> >
> > To get the script to run, at the bottom of page 110 add the
> > following line of code.
> >
> > objfilter.EventNameSpace = "root\cimv2"
> >
> > Hope that helps,
> >
> > Mark D. MacLachlan
> >
>
> What is the WQL event query in question?
Checking for file access of the DING.WAV file.

--

My System SpecsSystem Spec
Old 07-03-2009   #8 (permalink)
mr_unreliable
Guest


 
 

Re: Is it possible to trap as an event when a certain sound plays,

hls wrote:
Quote:

> Thanks, I will research the book.
> When Ding wav plays it is Southwest alerting at my pc.
> I want to trap and send a text to alert my cellphone.
>
Hi Harold,

I expect (even with a language more amenable to hooking
than vbs) that you are going to have trouble detecting
your "ding".

For a start, if you wish to consider vb, then take a look
at the vb Utilities found here. There are pre-programmed
utilities which make it easy to implement various types of
system hooks, including thread hooks (which you can do-it-
yourself in vb) and system-wide hooks (needs c++ or some
other more capable language such as delphi).

http://allapi.mentalis.org/vbexample...?category=MISC

You may have better luck with the process hook than anything
else. I suspect that "Southwest" (whoever they are) will have
to run some app or mini-app (IM?) to play the ding. It would
be easier to insert a process hook or a window hook to catch
the IM popup, than to attempt to catch an api call. (Generally
one will call a multimedia api to play a wav file, rather than
use a music player -- less overhead).

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but, no guarantee
the answers will be applicable to the questions)

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
With UAC off my game sound plays. UAC on...not so much.. Vista General
sound plays slowly Vista music pictures video
WMP plays video avi but no sound Vista music pictures video
WM PLAYS DVD'S BUT NO SOUND! Vista music pictures video
Sound plays for like a minute Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46