Author Topic: Possible to have a command with pauses for spoken input  (Read 3162 times)

Oilman100

  • Newbie
  • *
  • Posts: 3
Possible to have a command with pauses for spoken input
« on: May 23, 2021, 11:59:54 AM »
I’m looking to create an interactive command that executes with initial spoken command but pauses for further spoken input and then uses that input and continues until all remains command lines are executed. Is this scenario possible ?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
Re: Possible to have a command with pauses for spoken input
« Reply #1 on: May 23, 2021, 12:02:19 PM »
Yes, that can be done using the "Wait For Spoken Response" action.

Press F1 while VoiceAttack has focus to open VoiceAttackHelp.pdf in your default PDF viewer, which contains information on VoiceAttack's features.

Oilman100

  • Newbie
  • *
  • Posts: 3
Re: Possible to have a command with pauses for spoken input
« Reply #2 on: May 23, 2021, 03:31:26 PM »
I’ve looked that up and I’m not programming minded, so a little more explanation is required. How would I input 5 digits e.g script runs and starts keypresses, then script stops and I say ‘2’, ‘6’, ‘4’, ‘7’, ‘7’ , it would then input these digits as keypresses and continue with the script. Many Thx

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4786
  • RTFM
Re: Possible to have a command with pauses for spoken input
« Reply #3 on: May 23, 2021, 04:06:04 PM »
Depending on what you mean by "keypresses", something like this could work:
Code: [Select]
Start Loop : Repeat 5 times
    Wait for spoken response: '[0..9]'
    Write [Blue] '{TXT:~response}' to log
    Press variable key(s) [~response] and hold for 0,06 seconds and release
End Loop
which would press the keys associated with the numbers (I.E. those above the letters, not on the numpad)

If you want to use numpad keys instead, you can add this action right above the variable keypress action:
Code: [Select]
Set text [~response] to '[NUM{TXT:~response}]'
which will insert the number into the appropriate variable keypress indicator

The command will press each key as you speak the number, as otherwise the command becomes more complex in order to store and then recall that data.

Note that the "Write a Value to the Event Log" action is not required, but can be useful as feedback both that your input was recognized, and what was recognized (if you don't normally have VoiceAttack visible, this could be replaced with a "Say Something with Text-To-Speech" action, or a simple "Play a Sound" action if you only want to make sure the next number can be spoken).


This topic attempts to explain the basic principles behind actions such as the loop used in the example, and this topic attempts to summarize the basics regarding variables and tokens.

The official documentation provides further information on the features used.

Oilman100

  • Newbie
  • *
  • Posts: 3
Re: Possible to have a command with pauses for spoken input
« Reply #4 on: May 23, 2021, 04:27:27 PM »
Many thx for your quick response, I will try this out