Author Topic: WildCards in "Wait for spoken response" commands  (Read 1391 times)

noodleKnight

  • Newbie
  • *
  • Posts: 4
WildCards in "Wait for spoken response" commands
« on: July 12, 2021, 10:57:26 AM »
Hi all,

Recently picked up voice attack and I am super into it, it's honestly an amazing service for the price and I couldn't be happier.

I was just wondering about some wildcard functionality. Basically, I have a command set up in StarWars squadrons that spawns enemies while I'm in the practice mode. The previous version of the command waited for me to say "Deploy enemy units" asked me what type of units I'd like to deploy and then waited for me to respond with something like "fighters", "bombers" ...etc. then based on what I said it would spawn the appropriate units. Works great. However, I wanted to change these commands using wildcards so that the "wait for spoken response" would accept any inputs containing those words instead (i.e. "I'd like to go up against some bombers" or "fighters if you please"). I tried placing the responses between asterisks (as shown in the attached screenshot) but to no avail. Now the responses are not recognized at all.

What I am wondering is if I am doing something wrong or if this functionality is simply not available.

Thanks very much for your time, any and all assistance is greatly appreciated.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
Re: WildCards in "Wait for spoken response" commands
« Reply #1 on: July 12, 2021, 02:22:19 PM »
The "Wait For Spoken Response" action is intended for full, predefined phrases.

You could try using the dictation mode, then checking whether the recognized phrase contains the word(s) you're looking for.
You'll want to make sure any words that need to be recognized for the command to operate (I.E. the words you'll be actively checking for) are in the speech recognition dictionary, if they're not in there by default (E.G. "X-wing", "Tie-Fighter", etc...).
Essentially, if the word is recognized (as in, the speech recognition engine correctly transcribes it; obviously there will be an "Unrecognized" entry in the log, as no command was recognized) when you speak it in an empty profile containing no commands at all, that would indicate it's already in the dictionary.

You can click the wrench icon on VoiceAttack's main window, and on the "Recognition" tab of the VoiceAttack options window click the "Utilities >" button, then choose "Add/Remove Dictionary Words", to add words to the dictionary and record a pronunciation for them if you so wish. Note that the default words are not listed there, only those you add.


You can use the "{DICTATION}" token, a loop that checks whether that token returns something (to wait until the buffer actually contains something before continuing the command), and a set of conditions that looks for the keywords you may speak.

E.G.
Code: [Select]
Start Dictation Mode (Clearing Dictation Buffer)
Start Loop While : [{DICTATION}] Equals ''
End Loop
Stop Dictation Mode
Begin Text Compare : [{DICTATION}] Contains 'fighters'
    Press F key and hold for 0,01 seconds and release
Else If Text Compare : [{DICTATION}] Contains 'bombers'
    Press B key and hold for 0,01 seconds and release
Else If Text Compare : [{DICTATION}] Contains 'Darth Vader on a space moped'
    Press M key and hold for 0,01 seconds and release
End Condition

These topics may be of use in addition to the official documentation:
Control flow (If, Else, ElseIf, Loop, Jump) basics
Variables and tokens summed up

noodleKnight

  • Newbie
  • *
  • Posts: 4
Re: WildCards in "Wait for spoken response" commands
« Reply #2 on: July 12, 2021, 04:09:05 PM »
A terrific workaround, thanks so much!