Author Topic: Always have command phrase  (Read 531 times)

Emberblaze99

  • Newbie
  • *
  • Posts: 6
Always have command phrase
« on: June 14, 2024, 07:44:04 AM »
alright this is a fairly complex one and I'm not sure if it's doable at all. basically i have a profile which has the "override listening if my spoken command begins with:" set to the phrase "computer" and i want almost all commands in that profile (i can move the others to a separate profile if needed) to also listen for the word "computer' even when listening is enabled. but i don't want to say computer twice before a command.

a way i think i could implement it is maybe having a token in the "when i say" field that flips between being the word "computer" and being blank depending on weather listening is enabled, I'm almost certain there's a token or other way to extract the listening state from voice attack, but I'm not sure how to process that in such a way to get the resulting "computer" token.
perhaps with a loop? I'm not sure.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4781
  • RTFM
Re: Always have command phrase
« Reply #1 on: June 14, 2024, 08:33:19 AM »
Theoretically that could be done using the "IIF" expression with the "{EXP:}" token, as using tokens in command phrases is an undocumented feature.

However, any change to command phrases requires reloading the profile. That also means any running commands will be stopped.

Emberblaze99

  • Newbie
  • *
  • Posts: 6
Re: Always have command phrase
« Reply #2 on: June 14, 2024, 08:55:08 AM »
do you know of any other ways it could be done?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2831
Re: Always have command phrase
« Reply #3 on: June 14, 2024, 09:22:36 AM »
Right now in your setup, if you have a command with a spoken phrase of, say, 'fire weapons' and listening is turned off you must say, 'computer fire weapons' in order for that command to execute.  Turning listening back on, you can say either 'computer fire weapons' or just 'fire weapons' (this applies to all spoken commands).

Maybe I'm not clear on what it is you're trying to accomplish    ?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4781
  • RTFM
Re: Always have command phrase
« Reply #4 on: June 14, 2024, 09:27:27 AM »
The prefix configured for the "Override listening if my spoken command begins with" option is available regardless of whether listening is enabled or not, and will apply to any command, including those from included and global profiles.

I.E. if listening is suspended, if you want to trigger a command with the phrase "my command", you'd need to speak "computer my command".
If listening is *not* suspended, you could still trigger the same command by speaking "computer my command", *or* by speaking "my command".

If you want to use the built-in listening state, you'll need to work with those parameters.


Perhaps worth noting that commands that have the "Make VoiceAttack Start Listening" action at the top of their action list will also be recognized while listening is suspended.
Because this is intended to enable using a command to enable listening, it does mean no "Recognized" entry will be visible in the log, and that other events associated with the listening state change will occur.

Emberblaze99

  • Newbie
  • *
  • Posts: 6
Re: Always have command phrase
« Reply #5 on: June 14, 2024, 07:08:16 PM »
Right now in your setup, if you have a command with a spoken phrase of, say, 'fire weapons' and listening is turned off you must say, 'computer fire weapons' in order for that command to execute.  Turning listening back on, you can say either 'computer fire weapons' or just 'fire weapons' (this applies to all spoken commands).

Maybe I'm not clear on what it is you're trying to accomplish    ?
What I'm trying to accomplish is to always have my commands always start with the word computer, because the actions include shutting down, suspending and moving windows around. Which could be cataclysmic if erroneously triggered, but also things that I want to be able to intentionally trigger from my bed if I forgot to shut down my computer. And generally I need listening to be enabled most of the time or all of the time for my other profiles.

Emberblaze99

  • Newbie
  • *
  • Posts: 6
Re: Always have command phrase
« Reply #6 on: June 14, 2024, 07:24:28 PM »
Something cool that I just thought of, "scope limited listening status"
basically having each profile be able to set its own listening level via command, the button on the side always set the global listening state, irrespective of other profiles, and then you could modify the set listening state commands (start stop toggle) to be able to set individual listening states for profiles loaded globally or by the current profile.

This has nothing to do with the current question I just thought it'd be cool to share

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4781
  • RTFM
Re: Always have command phrase
« Reply #7 on: June 15, 2024, 12:25:07 AM »
As mentioned, if you have the "Make VoiceAttack Start Listening" action at the top of a command, it can be recognized even while listening is suspended.

E.G. with that configuration, while the phrase "computer computer my command" would exist, you don't need to use it, as the original phrase "computer my command" would still be recognized.



What could also be an option is to check whether the prefix was used using a condition inside the command, effectively making it mandatory even when listening is not suspended (thus foregoing the need to add it to the actual command phrase)
E.G.
Code: [Select]
Begin Condition : [{ISLISTENINGOVERRIDE}] Equals '1'
End Condition - Exit when condition not met
at the top of the action list.


Additionally, if you have commands that perform "cataclysmic" functions, consider adding a confirmation prompt to them, E.G. using the "Wait For Spoken Response" action and a condition. Examples of that configuration can be found in this topic.

Emberblaze99

  • Newbie
  • *
  • Posts: 6
Re: Always have command phrase
« Reply #8 on: June 15, 2024, 02:29:31 AM »
As mentioned, if you have the "Make VoiceAttack Start Listening" action at the top of a command, it can be recognized even while listening is suspended.

E.G. with that configuration, while the phrase "computer computer my command" would exist, you don't need to use it, as the original phrase "computer my command" would still be recognized.



What could also be an option is to check whether the prefix was used using a condition inside the command, effectively making it mandatory even when listening is not suspended (thus foregoing the need to add it to the actual command phrase)
E.G.
Code: [Select]
Begin Condition : [{ISLISTENINGOVERRIDE}] Equals '1'
End Condition - Exit when condition not met
at the top of the action list.


Additionally, if you have commands that perform "cataclysmic" functions, consider adding a confirmation prompt to them, E.G. using the "Wait For Spoken Response" action and a condition. Examples of that configuration can be found in this topic.
ah i can definitely use the {ISLISTENINGOVERRIDE} token for this, thanks