Author Topic: "Muting" the MIC  (Read 5489 times)

0 Members and 1 Guest are viewing this topic.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
"Muting" the MIC
« on: July 11, 2014, 07:05:54 PM »
because I am implementing VC in open mic setup ... I have been using SpeakSync to avoid that VC hears itself ... it works good but has its limitation, like No Head ... Can't stop the speech once triggered (real pain when a large page of text is Passed to it)...etc.

at one point I noticed that now there is 2 new events; tts.start and tts.end ... and I am thinking that this can be part of a perfect solution for Async. speech in open mic. that is "muting" the mic once tts.start then "unmute" the mic once tts.end ... it is true that one won't be able to stop the speech through saying a command ... but it will be an option to send a command by a remote ....

what I need help with, is the way to mute the mic ... as I did not find any VC command to manipulate the mic volume ...

Any ideas ?
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: "Muting" the MIC
« Reply #1 on: July 11, 2014, 07:18:01 PM »
There is no existing action for that except for VC.Off and VC.On

Unfortunately that may have other effects if you have events tied to those...  You might be able to find a third party program that can mute your microphone but don't disable it because then VC will probably not work when you re-enable it, until VC is set to Off and then back On.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: "Muting" the MIC
« Reply #2 on: July 11, 2014, 07:21:36 PM »
I'm not sure it's the best idea but you might be able to use VC.SetSpeechInput to switch to an inactive mic and then back again.  Mileage will vary.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: "Muting" the MIC
« Reply #3 on: July 11, 2014, 08:22:02 PM »
I'm not sure it's the best idea but you might be able to use VC.SetSpeechInput to switch to an inactive mic and then back again.  Mileage will vary.

tried that ... but windows starts to default randomly ... will check if I can find a pattern and fix it ...
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: "Muting" the MIC
« Reply #4 on: July 11, 2014, 09:37:38 PM »
but windows starts to default randomly ...

Sorry but I don't know what this means.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: "Muting" the MIC
« Reply #5 on: July 14, 2014, 03:38:12 PM »
I have had hit and miss success using NirCmd (http://www.nirsoft.net/utils/nircmd.html) to mute/umute my microphones. It works with my built-in microphone, but so far I haven't had any success with USB microphones.

For my default device labelled 'microphone', the command   
Code: [Select]
nircommand.exe mutesysvolume 2 microphonesuccessfully toggled the mic mute on and off as long as it was set as the default device in both the recording *and* the playback tabs.

Don't know if it's worth trying to get it to work w/ your Kinect mic or not. Probably a long shot.
« Last Edit: July 14, 2014, 03:49:57 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Tougharms

  • $upporter
  • Jr. Member
  • *****
  • Posts: 10
  • Karma: 0
    • View Profile
Re: "Muting" the MIC
« Reply #6 on: July 17, 2014, 05:48:37 PM »
Hi there,

I'm a relatively new member to the forum, and have been using VC since 1.185.

I have had problems with using an open mic and had the same problem with being unable to mute the mic.

After a bit of lateral thinking, i came up with a command to "disable everything" using multiple
VC.DisableGroup* (note the asterisk) instructions.

I found that the VC.DisableGroup* does not rely on the letter being at the start of the group name, so to disable all groups quickly I hit on the idea of using the vowels as most words have at least one vowel. I had to include X as well for XBMC!

After disabling everything i use VC.EnableGroup* to re-enable a single group called "_Do not disable" (the underscore is just my way to keep it at the top of the list. Keeping this group enabled allows me to say "enable everything" to bring it all back.

Here is my code for disable everything:

Code: [Select]
<command id="1000" name="Disable everything" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
            <action>
                <cmdType>VC.TriggerEvent</cmdType>
                <params>
                    <param>VC.Standby</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>VC.DisableGroup*</cmdType>
                <params>
                    <param>A</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>VC.DisableGroup*</cmdType>
                <params>
                    <param>E</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>VC.DisableGroup*</cmdType>
                <params>
                    <param>I</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>VC.DisableGroup*</cmdType>
                <params>
                    <param>O</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>VC.DisableGroup*</cmdType>
                <params>
                    <param>U</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>VC.DisableGroup*</cmdType>
                <params>
                    <param>X</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <action>
                <cmdType>VC.EnableGroup*</cmdType>
                <params>
                    <param>_Do</param>
                </params>
                <cmdRepeat>1</cmdRepeat>
            </action>
            <event>Disable everything</event>
        </command>

You may have noted that it also puts Vox into standby. My 'enable everything' command has always on checked and includes VC.On

It's big, messy and far from elegant, but hey, that's me! Also, it works for me and that's what counts.

As you can see, the command is actually triggered by an event, so I guess it can be triggered by TTS.Start?

I won't list my command for "enable everything" because it is much longer than the 'disable everything', as it actually only enables specific groups (I have multiple instances of play, pause, stop etc for XBMC, VLC, MP3 player and DVD), but it's also triggered by an event, so I guess in your case event TTS.End could be used.

I'm sure the experts will correct if I am wrong.

Hope this helps and sorry for the long post.

I stood in the shadow of the moon!

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: "Muting" the MIC
« Reply #7 on: July 18, 2014, 12:05:34 PM »
Tougharms very interesting approach ... however, I would test with putting VC.Off as when VC speakes even in standbye mode sometimes gets false positives ...
for the moment I don't have a plan on what to disable when ... but I think it can become a strategy to control what is enabled and when, to reduce false positives ...

thanks for the feedback and the code
When Voice command gets tough, use hand gestures

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: "Muting" the MIC
« Reply #8 on: July 18, 2014, 12:51:17 PM »
I want give you the hint, that it is possible to use a logic block to activate a group when a specific program is running or focused. If you start XBMC, VC can disable all other mediaplayer groups.

Here is a example how you can use the logic block:
IF ProcessRunning - vlc  THEN  Group.DisableRegEx - XBMC or IF ProgramFocused - vlc THEN Group.DisableRegEx - XBMC

I find also a nice solution (I hope) to mute your mic when TTS speak - you need only the thirdparty program "PushToTalk" for Win7/8 which I have tested http://www.pushtotalk.nu/. The program can run minimized and work in your case also reverse (mute by press the button) and it is free. I created a group with two commands which simulate the press button to mute the mic when event TTS.start is fired and also release the button when the event TTS.end is fired. I hope this will help you.

the pressed button in the command is "right control" to mute the mic, you must set this in the PPT software first and also the mic which you want mute. Don't forget to mark "start as minimized" and "push to mute"

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.0-->
<commandGroup open="True" name="mute mic while TTS speak" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="474" name="mute mic while TTS speak" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>InputKeys.KeysDown</cmdType>
      <params>
        <param>{RCONTROL}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>tts.start</event>
  </command>
  <command id="488" name="unmute mic after TTS speak" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>InputKeys.KeysUp</cmdType>
      <params>
        <param>{RCONTROL}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>tts.end</event>
  </command>
</commandGroup>
« Last Edit: July 18, 2014, 04:54:52 PM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: "Muting" the MIC
« Reply #9 on: July 18, 2014, 01:24:41 PM »
In version 2 we have new actions for turning groups on and off.  A regular expression pattern can be used to turn multiple groups on and off.

I must say though that I don't personally see the point of turning almost all groups off.  :). It just makes the groups that are still on more likely to trigger falsely.

If you are getting false positives when in standby mode then you should probably reevaluate the phrases used to turn VoxCommando back on, and consider changing your prefix if you are using one.

If TTS is causing problems then use speaksync exclusively with the option to not listen during speaksync.  I realise this makes the talking head unusable (for now)  but I think it's a small price to pay.

Eventually I will offer another solution that disables the mic even with normal TTS.speak or I will find a way to do speaksync with the head.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: "Muting" the MIC
« Reply #10 on: July 18, 2014, 01:29:54 PM »

I find also a nice solution (I hope) to mute your mic when TTS speak - you need only the thirdparty program "PushToTalk" for Win7/8 which I have tested...

Nice!  :clap

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: "Muting" the MIC
« Reply #11 on: July 18, 2014, 03:52:39 PM »
Kalle: many thanks for the feedback and the code ...

I find also a nice solution (I hope) to mute your mic when TTS speak - you need only the thirdparty program "PushToTalk" for Win7/8
nice ...

in fact I connect the Kinect mic to Noise Gator (http://sourceforge.net/projects/noisegator/) .. and noise gator to VC using virtual cable ... I live very close to the street and train tracks, and it helps a bit reducing false positives ... it has a mute button, but it is a Java app and I did not have the time to find if VC can mute the app ...

in general I prefer keepings things as much as possible within VC ... easier for modifications and debugging ...



If TTS is causing problems then use speaksync exclusively with the option to not listen during speaksync.  I realise this makes the talking head unusable (for now)  but I think it's a small price to pay.

Eventually I will offer another solution that disables the mic even with normal TTS.speak or I will find a way to do speaksync with the head.

James I originally used TTS"SpeakSync exclusively ... but if VC start reading a News article there is no way to stop it ... that is why I am trying to switch to TTS.Speak ... talking head is not an issue since I run VC on headless PC ...

thank you all for the feed back will experiment with the various ideas ... and see how the solution will develop ...


« Last Edit: July 18, 2014, 03:56:05 PM by Haddood »
When Voice command gets tough, use hand gestures

Tougharms

  • $upporter
  • Jr. Member
  • *****
  • Posts: 10
  • Karma: 0
    • View Profile
Re: "Muting" the MIC
« Reply #12 on: July 18, 2014, 06:37:40 PM »
My approach with the 'disable everything' was to only leave one group active.

This group only has two commands in it, so not much chance of false positives :) and Vox doesn't give 'not recognized' or 'too low' responses if the other groups are disabled.
I stood in the shadow of the moon!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: "Muting" the MIC
« Reply #13 on: July 18, 2014, 07:28:41 PM »
At great personal risk of "never hearing the end of it" from my spouse for my documentation failures, I present to you a possible solution.

These are hidden actions that have been there for AGES!  So long in fact that I forgot about them...

:biglaugh

They may not work on all microphones...

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.2-->
<commandGroup open="True" name="Automute microphone on TTS.Speak" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1039" name="mic mute" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Sound.MicMute</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>tts.start</event>
  </command>
  <command id="1040" name="mic unmute" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Sound.MicUnMute</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>tts.end</event>
  </command>
</commandGroup>

Tougharms

  • $upporter
  • Jr. Member
  • *****
  • Posts: 10
  • Karma: 0
    • View Profile
Re: "Muting" the MIC
« Reply #14 on: July 18, 2014, 07:37:30 PM »
Genius  ::bow

Works on a Samson GoMic.

Now I can get rid of 'disable everything' (never liked it anyway ;D)
I stood in the shadow of the moon!