detect if microphone is using
Is there an API that could detect if someone is using microphone to talk/speak? What happened was my program got closed when the screen saver kicks in, the user does not use mouse/keyboard and simply use microphone to interact with the computer. Screen saver kicks in because it "thinks" that user inactivity. So I want my program to detect that and then disable the screensaver.
Re: detect if microphone is using
Why don't you just disable screen saver during the use of your program
Re: detect if microphone is using
There really is not much need for a screen saver if you are using a LCD monitor anyway.
The purpose of a screen saver was to prevent screen burn in which would happen over time on the CRT screens if a static image was displayed for very long periods, Plasmas were worse but is a none factor on LCD monitors. I am not sure about the LED ones.
Re: detect if microphone is using
Here's a simple hack based on some code I found on the Internet:
Code:
Private WithEvents tmrToggleScrollLock As VB.Timer
Private Sub Form_Load()
Set tmrToggleScrollLock = Controls.Add("VB.Timer", "tmrToggleScrollLock")
tmrToggleScrollLock.Interval = 59000 '59 secs is < screensaver's min timeout
End Sub
Private Sub tmrToggleScrollLock_Timer()
CreateObject("WScript.Shell").SendKeys "{SCROLLLOCK}{SCROLLLOCK}"
End Sub 'VB's SendKeys couldn't press ScrollLock
It works by resetting the screensaver's timeout value by programmatically toggling the Scroll Lock key twice just before the minimum timeout (1 minute) for screensavers elapses.
Re: detect if microphone is using
Looks like OK code for disabling Screen Saver. I don't think he asked how to do that - he asked how to detect if mic is in use. I get impression for OP's post he already knows how to disable SS. But...then maybe not
Re: detect if microphone is using
Quote:
Originally Posted by
jmsrickland
I don't think he asked how to do that - he asked how to detect if mic is in use.
Since the OP's program does use the mic, there's no point in trying to detect it. I believe what the OP really wants is to prevent the screensaver from starting whenever the OP's app is running. There are numerous ways of achieving that (as I found out via Google), including the disabling of the screensaver via some system setting.
Re: detect if microphone is using
Quote:
Originally Posted by
jmsrickland
Why don't you just disable screen saver during the use of your program
Quote:
Originally Posted by
Bonnie West
I believe what the OP really wants is to prevent the screensaver from starting whenever the OP's app is running.
Looks like you two are in violent agreement :D:D
The OP could have been phrased better; I was getting hung up on "my program got closed when the screen saver kicks in" which I thought was strange and also "use microphone to interact with the computer" as opposed to "..... with my program".
Re: detect if microphone is using
I just got back to this. I know how to disable the screensaver. Does that mean there's no way to detect if microphone is in used?
Re: detect if microphone is using
That doesn't make any sense. If you are running an application on, let's say, PC1 you should know if the mic is in use because you or someone is at that computer. Besides, if you know how to disable Screen Saver then why be concerned about if the mic is in use just disable Screen Saver anyway; in other words pretend the mic is in use and do the disabling.