Author Topic: Global Command that is always executed in combination with all other commands  (Read 4791 times)

Anon22

  • Guest
Hello,

I am trying to implement a system where I tell voice attack to stop listening and then if no command has been issued in the last 60 seconds stop listening again.

So far I have a variable that is set +1 every 5 seconds in a loop and once it reaches 12 the loop exits and listening is stopped. Now I would like it so that this variable is reset every time a different command is executed.

There are options to have commands that execute every time the profile is accessed or every time a dictation is recognized but I can't seem to find a way to have something that is executed every time a command is launched.

I could add that piece of code to every command but that would be very tiresome as I have around 180 commands so far. it would also mean that I have to remember adding it to every future command  :-\

Anyone have an idea?


Thanks in advance

Anon

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
I am trying to implement a system where I tell voice attack to stop listening and then if no command has been issued in the last 60 seconds stop listening again.
I'll assume one of those stops is a "start" instead.

You can monitor the "{CMDCOUNT}" token to check if a command has been executed, with the caveat that any execution method will increment it(E.G. keyboard keys, plugins, etc...).

As it's not currently possible to trigger a command each time a command phrase is recognized, that's probably about the closest you'll get without modifying your commands.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
There is currently no 'On Recognized' command exec.  This request comes up quite a bit, actually.  Mostly so that there can be some indication to the user that a command has been recognized and often with, 'this shouldn't be too hard to implement, as you've already done this for other stuff' (which is correct, you'd think it should be that simple, right?). 
There would actually need to be two commands - one for before and one for after, as just having one would not satisfy everybody's need.  Then, there needs to be rules around it, such as does each occur with any or all user-executed commands (spoken, mouse, joystick, keyboard, external (inline, plugin), command-line, etc) or do they occur with just a spoken command?  Do they execute with with subcommands or just root commands.  The list goes on.  All this also takes time to figure out when a command executes, so there would be some overhead there as well.  You can see why I drag my feet on this ;)

Wildcard

  • Guest
Voice on, Voice Control On, Astra wake up
Start VoiceAttack listening
Play sound, '{VA_SOUNDS}\hcspack\acknowledgements\initiating.mp3'
Pause 2 seconds
Play sound, '{VA_SOUNDS}\hcspack\acknowledgements\awaiting orders.mp3'

Voice Off, Voice Control Off, Astra go to sleep
Stop VoiceAttack listening
Play sound, '{VA_SOUNDS}\hcspack\rank\sir\yes sir 2.mp3'


VA is always listening, when in Voice off mode its still listening but its waiting for the conditional on


You can run these commands in other commands.

K4tniss

  • Guest
I just signed up because I thought 'execute on dictation phrase recognized' would do just this and I thought I had a bug report ^^ I'm trying to set up a 'recognition' sound like all the rest.

(I'm sorry if I'm responding to a thread too late? I'm not sure what the boundaries are on that, I just didn't want to remake a new thread for the same topic?)

Could you just always run one before/after, and leave 'does it execute for keyboards, voice, subcommands' to always and use tokens like {CMDACTION} and {CMDISSUBCOMMAND} to differentiate?
Although as far as I understand, {CMDACTION} doesn't currently support multiple sources, and for consistency there would probably be a 'Recognized' value that would override the others, so maybe that doesn't work.
That does require more set up for a basic recognition noise in a more complicated setup, but only if they have a more complicated profile to begin with? idk. i wanted to voice it, and I hope it helps in some way or isn't too much of a bother ^^

then, I'm lazy and I don't want to add "execute another command: beep" in all of my commands /s

Have a nice day, and I love VoiceAttack so thanks! i've been using it for I believe a few years now

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Maybe just simply adding a, 'play this sound when a command is recognized' would suffice?  It would do just that... nothing fancy and it would just run in a separate thread so that it doesn't bog anything down.  It would at least satisfy THAT need, and the rest can just wait.