Author Topic: question about switching speech profiles  (Read 2364 times)

0 Members and 1 Guest are viewing this topic.

deathtech

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 1
    • View Profile
question about switching speech profiles
« on: July 24, 2016, 01:11:08 AM »
So I had this thought, and tried to implement it but failed.

Heads up, i'm using the voxcommando legacy version 1 just FYI:

What my thought was, is to, when I say a command "computer", or whatever, detect the recognition of that command, if its above a threshold say 90+ then leave it on the speech profile its currently on, if below, then switch to the second profile i.e my wife's. Simple enough but not having any luck there.

I was able to get the previous command, the one I want detected, and store it in a variable, but now i need to know if this variable failed was less than my threshold.

The thing is, there is no ability native I see within Vox to grab the last commands speech recongnation percent attempt. it shows up in the info panel, but not the logs its self, so i cant scrub that and use it in code as i hoped. Nor is there a native approach, that I saw.

I think if i can get this to work, this could be an awesome way to recognize the users and switch between at least two profiles as its been spoken, maybe.. I know there is a restart that is needed to occur, i'm beyond that.

Any thoughts or ideas? I see there is a new variable that was created in version two called: {LastInfo} it does reference the logs, is this the key i'm missing? will this give me the last commands percentage?

Thanks in advance as always!

EDIT: I think even knowing if the attempted command failed would work, but i'm not even able to get that ability to function, the lastactionsuccess in the logic didn't help there either.
« Last Edit: July 24, 2016, 01:14:56 AM by deathtech »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: question about switching speech profiles
« Reply #1 on: July 24, 2016, 09:28:10 AM »
What you are trying to do is definitely not possible with VC version 1.

I think it might be doable in VC2 (using Python), however I personally think it will be more trouble than it's worth.

Do you really get consistent 90%+ confidence every time you issue a command?  With various other sounds and particularly with certain commands I frequently get a wide range of confidence values on correctly interpreted commands, going down as low as 60%.  How annoying would it be if VC not only did not execute my command but then switched to a mode where it was even less likely to understand me, and having to wait for it to change profiles, then having to try to get it to switch back to the correct profile again?  Very annoying I think.  In my opinion it makes far more sense to simply use a voice command to tell VC that you want to switch to a new profile.  "This is James", or even something less obvious.  One of you says "hi there pookie" for their profile and the other says "greetings Jarvis".

I'm not too sure, but I suspect that switching profiles only works in VC2.  In the not too distant past I recall fixing a bug that was preventing VC from switching profiles correctly.  It's fixed but I don't know if that bug went as far back as version 1 which is now about 5 years old!

It helps to know what an "action" is.  http://voxcommando.com/mediawiki/index.php?title=Actions
Your command macro is made up of actions.  So trying to use LastActionSuccessto determine if your confidence was too low is definitely barking up the wrong tree.  You speaking is not an action.

As your command macro executes actions they will appear in the history window with a green gear icon next to them.  If an action fails for some reason then the background of the action will turn orange in the history window.  When that happens your macro could detect it using a logic block and LastActionSuccess.

Here is an example that should hopefully make it clear (not tested on V1)
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.2.2-->
<command id="1191" name="LastActionSuccess example" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Launch</cmdType>
    <params>
      <param>nonexistant thing</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>LastActionSuccess</ifType>
    <ifParams>&amp;&amp;</ifParams>
    <then />
    <else>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>I can't launch that!</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
</command>

{LastInfo} is similar to {LastResult}.  Some actions are intended to return a result so you can use {LastResult} but many actions do not return a result.  Still they will usually return some kind of information which you can see in the history window by rolling over them.  In some very rare cases it might be useful to be able to read this value which is why we recently added the {LastInfo} variable, but I doubt anyone other than Haddood is using it.  :biglaugh
« Last Edit: July 24, 2016, 09:31:42 AM by jitterjames »

deathtech

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 1
    • View Profile
Re: question about switching speech profiles
« Reply #2 on: July 25, 2016, 10:47:48 AM »
Thanks for the reply James!

Here are some answers to your questions.

It's just an experiment, but haven't been able to get past the not knowing the last confidence values, so unable to attempt it.

Having my wife say a command and then I is not even remotely possible. If its on either on each other profiles, i'm 60% steady on results and she is 90+ and vice versa when switched. I'll never get it to switch back to my profile once its on hers. The idea, is if its on either, saying a specific command only, not every command, this command when confidence is low, will switch the profiles. How well this would work is unsure but again see above, for it being an experiment ;)

I'd also figure the lastactionsuccess is as you have outlined below, but just pointed it out incase i failed to 100% understand it.

And yes profile switch works correctly in version 1! I have no issues with the latest version 1 in profile switching.


You said it maybe doable using python in version 2, what are your thoughts on how to get the last confidence for a command using python? As i see that value for confidence is not stored anywhere for me to even obtain it and work with it. I'd love to hear your thoughts on it!


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: question about switching speech profiles
« Reply #3 on: July 25, 2016, 11:15:56 AM »
Having my wife say a command and then I is not even remotely possible. If its on either on each other profiles, i'm 60% steady on results and she is 90+ and vice versa when switched. I'll never get it to switch back to my profile once its on hers.

I find this very difficult to accept. If you are getting 60% on each other's profiles then yes you actually can use this technique.  I don't understand why you say it is "not even remotely possible".

Anyway, I just installed version 1 to refamiliaize myself with it and I see that there are two events you can use to do exactly what you want.  They are: VC.Reco.TooLow and VC.NotRecognized

Just use those events to trigger a command that will switch profiles.  Using this method you don't need to know the confidence, but the VC.Reco.TooLow event actually does include the confidence as a payload.

http://voxcommando.com/mediawiki/index.php?title=Events

deathtech

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 1
    • View Profile
Re: question about switching speech profiles
« Reply #4 on: July 25, 2016, 11:28:33 AM »
Holy crap how did I not notice the event of VC.Reco.TooLow. I guess I was too busy trying to make it complicated. I see it now, i'll test it out. Thanks for that!

Also, difficult or not, its the way the cookie has crumbled on this end. Her profile is trained multiple times with her voice and same with mine. Its very precise. 60% is never a steady number, but it was not relevant either, as i know its never very high, in the 80s etc, never there.


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: question about switching speech profiles
« Reply #5 on: July 25, 2016, 11:35:03 AM »
I hope you know that you can lower the required confidence for a specific command.  60% is more than adequate to be able to switch profiles, and if you use a long enough phrase I bet you can get it to work 9 times out of 10 even when using the other person's profile.

Enjoy your experiment but keep in mind my advice.  Believe it or not, I actually know what I'm talking about!  :biglaugh

deathtech

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 1
    • View Profile
Re: question about switching speech profiles
« Reply #6 on: July 25, 2016, 11:37:57 AM »
oh indeed, i never doubted that, hence why I came back on the forum to ask.

But there are scenarios here you don't understand as you have not seen them. As in, its in the living room, with lots of background noise, and having it keep switching back and forth just hearing some random noise is not idea either.  Anyways, its moot, i'll use the data you gave me and run with my evil experiments!

Thanks again

deathtech

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 1
    • View Profile
Re: question about switching speech profiles
« Reply #7 on: July 25, 2016, 05:58:21 PM »
James, any idea how I can do an AND? with logic.

Needing to say If this and this, then do that.

EDIT: actually i think this just worked: &

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
« Last Edit: July 25, 2016, 07:01:28 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)