tags:

views:

97

answers:

2

Can someone give me some info/background info on how I might go about writing an application that 'listens' to the sounds being made by the computer's sound card or a specific other program.

For example, if I kicked off a long-running 3rd party app that gives no indication of when it is done, except a loud 'DING!' sound. Is there anyway my application could 'listen' for that 'DING!' and then take some action?

I realize there are probably ways to avoid using sound in most situations, but I'm more curious than anything else.

A: 

Does the other process exit after completion? You can always keep a handle on it and tie an event handler to it's exit

Tracker1
A: 

I can't really take credit for this; but I found my answer on CodeProject:

http://www.codeproject.com/KB/vista/CoreAudio.aspx

Determining how loud the current 'sound level' is becomes as easy as this:

Dim curVol As Integer = CType(SndDevice.AudioMeterInformation.MasterPeakValue * 100, Integer)

So, as long as you are trying to detect a large increase in sound (like a loud DING!); it actually becomes pretty easy.

Rob P.