Author Topic: Remembering users?  (Read 3158 times)

0 Members and 3 Guests are viewing this topic.

Spenner11

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
  • British laddo, kicking it in B.C
    • View Profile
Remembering users?
« on: November 05, 2014, 01:27:44 PM »
I was wondering if there is any way for VC to remember who it is talking to using payloads?
I do not wish for VC to do anything else but to remember who it is speaking to, so for example.
(There is only myself and my partner living in my home)
Command: Jarvis this is *Name* giving you commands.

I then wish to be able to ask VC who it is speaking to at any given time and it reference the previous command, even if the last time it was spoken was hours ago...
so for example
command: Jarvis who am i?
VC would then return the correct answer providing the original command was given whenever there is a user change.

If anyone has any idea's or can point me in the direction of something similar that has already been done :)
cheers
Jamie


Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Remembering users?
« Reply #1 on: November 05, 2014, 02:21:50 PM »
should be pretty easy:
 use: Command: Jarvis this is *Name* giving you commands. (name coming from payload list or xml)
to set a variable called CurrentUser to the name.
 then command: Jarvis who am i?  will speak {var.CurrentUser} ...

and you can this variable in any command to give personalized response...
 Jarvis what is my dad phone
   if {var.CurrentUser} = User 1 ... speak user 1 dad phone number
   if {var.CurrentUser} = User 2 ... speak user 2 dad phone number
..etc.

hope that helps. however, other more seasoned/experienced user (or James/nim5ter) might have a better approach
« Last Edit: November 05, 2014, 02:51:23 PM by Haddood »
When Voice command gets tough, use hand gestures

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Remembering users?
« Reply #2 on: November 05, 2014, 02:23:43 PM »
Maybe this is for what you search  ;)
copy and paste the command group in your VC command tree.
Haddood you are faster  :D

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.0.3-->
<commandGroup open="True" name="rembering a user" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="441" name="remembering a user" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>Hi {1}, I'm ready for your commands.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>User</param>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>this is</phrase>
    <payloadList>David, James, Paul, Alex</payloadList>
    <phrase>giving you commands</phrase>
  </command>
  <command id="442" name="Who am I" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>{Var.User}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Who am I</phrase>
  </command>
</commandGroup>
« Last Edit: November 05, 2014, 02:42:38 PM by Kalle »
***********  get excited and make things  **********

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Remembering users?
« Reply #3 on: November 05, 2014, 02:43:56 PM »
@ Kalle ... not really ... you gave a whole command xml  :clap :clap :clap
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remembering users?
« Reply #4 on: November 05, 2014, 03:34:01 PM »
Get a room guys...


Spenner11

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
  • British laddo, kicking it in B.C
    • View Profile
Re: Remembering users?
« Reply #5 on: November 05, 2014, 03:59:52 PM »
Kalle the command xml you supplied is perfect. Thanks so much!

Also Hadood thanks for the tips on the personalized responses!

Now for a bit of tinkering! :bonk

Cheers guys!  :clap
« Last Edit: November 05, 2014, 04:25:01 PM by Spenner11 »

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Remembering users?
« Reply #6 on: November 06, 2014, 02:15:36 AM »
When Voice command gets tough, use hand gestures

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Remembering users?
« Reply #7 on: November 06, 2014, 02:41:07 PM »
@Spenner11, there is as well another way you can make VC know who is speaking but requires more work. But more natural and casual

In my case for every command (this is the extra work) I added at the end optional words: dude, darling (One per different different user)
Install the following PY script http://voxcommando.com/forum/index.php?topic=1689.msg14689#msg14689
It will generate an event whenever VC recognize something ....
Create a command that triggers with vc.reco event ... In it put:
If {LastSpoken} containe dude
   var.user = 1
If {LastSpoken} containe darling
   var.user = 2

So if you want to speak to VC and you doubt that another user used it ... Just say " what is my dad phone number, dude" and VC should give the right answer

I use this as well to switch user profile for SAPI as my significant other has a very different accent and VC has hard time understanding us both under one profile

You can even set a timer for VC to revert to a default user after x amount of time
When Voice command gets tough, use hand gestures

Spenner11

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
  • British laddo, kicking it in B.C
    • View Profile
Re: Remembering users?
« Reply #8 on: January 15, 2015, 12:54:49 PM »
"I use this as well to switch user profile for SAPI as my significant other has a very different accent and VC has hard time understanding us both under one profile "

Can you tell me more about this Hadood?
My wife and myself have the same issue as you, I changed the command so when I told VC who I was, it changed the speech profile....the problem I found with that method was, VC had to restart, then it no longer remembered who it was talking to...
Multiple commands could easily solve this but I wanted something that just flows, I tell VC who I am, changes speech profile, and still remember the user.

Any suggestions?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remembering users?
« Reply #9 on: January 15, 2015, 01:07:54 PM »
My wife and myself have the same issue as you, I changed the command so when I told VC who I was, it changed the speech profile....the problem I found with that method was, VC had to restart, then it no longer remembered who it was talking to...
Why does VC have to restart?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Remembering users?
« Reply #10 on: January 15, 2015, 01:17:28 PM »
Anyway, in general if you want to save a value and use it again even after VC has restarted, you should use Maps instead of Variables.  Maps store values in a database table so restarting VC will not clear its value.

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