Author Topic: Changing options  (Read 6532 times)

0 Members and 4 Guests are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Changing options
« Reply #15 on: April 23, 2014, 06:10:55 PM »
Bummer.

I always recommend notepad++

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Changing options
« Reply #16 on: April 28, 2014, 06:41:00 PM »
Finally I got the command to change options completed ... it was a good learning experience

the only thing is I still have to manually restart the program ... for the prefix change to happen ... it is like the Purge Cash Menu do more than deleting the files in srgr folder...

any feed back appreciated ...

here is the code

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="486" name="change option" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="command that changes the options file&#xD;&#xA;payload 1: is name&#xD;&#xA;payload 2: is value&#xD;&#xA;">
  <action>
    <cmdType>File.Read</cmdType>
    <cmdString>options.xml</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>File.Copy</cmdType>
    <cmdString>options.xml&amp;&amp;options.xml.bak</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <cmdString>&lt;Option name="{1}" value=".*" /&gt;&amp;&amp;&lt;Option name="{1}" value="{2}" /&gt;</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>File.Write</cmdType>
    <cmdString>options.xml&amp;&amp;{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;PrefixString</ifParams>
    <then>
      <action>
        <cmdType>File.GetFiles</cmdType>
        <cmdString>C:\Extensions\Vox Commando\srgs&amp;&amp;*.cfg</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>File.Delete</cmdType>
        <cmdString>{Match.{i}}</cmdString>
        <cmdRepeat>{#M}</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <action>
    <cmdType>VC.RestartFull</cmdType>
    <cmdString />
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>close vc and open</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>Change Option</event>
</command>
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Changing options
« Reply #17 on: April 28, 2014, 06:53:47 PM »
the only thing is I still have to manually restart the program ... for the prefix change to happen ... it is like the Purge Cash Menu

Yes you must restart the program in order to force VC to load the new options file.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Changing options
« Reply #18 on: April 28, 2014, 07:01:32 PM »
Fancy.  Nice job. :)

Use at your own risk!

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Changing options
« Reply #19 on: April 29, 2014, 12:18:13 AM »
Yes you must restart the program in order to force VC to load the new options file.

James,
So when I trigger VC.restart full It is not the same as quitting the program and starting it again ?

Fancy.  Nice job. :)

Use at your own risk!
Thanks :) ... And it is because of the risk I create a backup file :)



When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Changing options
« Reply #20 on: April 29, 2014, 08:30:23 AM »
In version 2 it actually restarts the program.

In version 1, it does a purge cache and then quick restarts, which forces a rebuild of all groups, but does not reload options.

The backup only works if you execute your command only once.  As soon as you execute it a second time your backup gets overwritten.  Anyway it is no big deal.  You can always just delete the options file and restart to restore default values.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Changing options
« Reply #21 on: April 29, 2014, 04:08:39 PM »
In the setup I am doing I need to use prefix all the time to reduce false positives ( using kinect mic)
And I would like to add different assistants ....

Amy: turn off the lights ... And Amy answers
Rather than saying Niles turn if the lights and the confirmation comes with a female voice

Just wanted to let you know that you've inspired James.

As of the latest VC2 update (1.9.3.1), your desire to engage with multiple assistants simultaneously can be implemented using one simple command, triggered by a VC.Prefix.Start event.

Other users might also find this fun.

The idea is that you can use the assistant names as prefixes (e.g. Bridget, Paul). Then create a command, triggered by a VC.Prefix.Start event, that changes the TTS voice.

Along the lines of:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.3.1-->
<command id="1160" name="prefix change voice" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;Paul</ifParams>
    <then>
      <action>
        <cmdType>TTS.SetVoiceName</cmdType>
        <params>
          <param>Paul</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.SetVoiceName</cmdType>
        <params>
          <param>Bridget</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>VC.Prefix.Start</event>
</command>

Payload {1} in the above xml is the prefix that was used to issue the command. (As always, you can roll over the prefix.start event in the history window to see the associated payloads.)

... Note that you don't have to use the official names of the TTS voices as your prefixes; I just did that to make things simple.
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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Changing options
« Reply #22 on: April 29, 2014, 09:30:22 PM »
I also plan to add some new actions to version 2 in the near future.

VC.PurgeCache
VC.ReloadOptions

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Changing options
« Reply #23 on: April 30, 2014, 01:53:15 AM »
Just wanted to let you know that you've inspired James.

Wow I am really flattered  ;D

and really impressed how you guys are involved in the forums and VC development

I also plan to add some new actions to version 2 in the near future.

VC.PurgeCache
VC.ReloadOptions


That is great news ... It will render VC more dynamic  and adaptive ...

Changing prefix and manipulating options has another side apart from the fun of multiple assistants, for instance I am looking for a way to detect noise in the background ... And if noise detected fire an event in VC to change the prefix with a longer one with multiple words and increase required confidence to reduce false positives in an open mic implementation

Thumbs up ... You guys rock (James notice I spelled guys correctly this time  :biglaugh)



When Voice command gets tough, use hand gestures