|
-
Oct 8th, 2013, 01:01 PM
#1
Thread Starter
Frenzied Member
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.
-
Oct 8th, 2013, 01:11 PM
#2
Re: detect if microphone is using
Why don't you just disable screen saver during the use of your program
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Oct 8th, 2013, 05:27 PM
#3
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.
-
Oct 8th, 2013, 05:59 PM
#4
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.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Oct 8th, 2013, 06:32 PM
#5
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
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Oct 8th, 2013, 11:42 PM
#6
Re: detect if microphone is using
 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.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Oct 9th, 2013, 12:24 AM
#7
Re: detect if microphone is using
 Originally Posted by jmsrickland
Why don't you just disable screen saver during the use of your program
 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  
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".
-
Oct 16th, 2013, 03:14 PM
#8
Thread Starter
Frenzied Member
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?
-
Oct 16th, 2013, 06:28 PM
#9
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.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
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
|