VoiceAttack
Profiles, Commands and Plugins => Profile and Command Discussions => Topic started by: Pfeil on June 23, 2019, 04:50:42 PM
-
Start Dictation Mode (Clearing Dictation Buffer)
Set date [~speechTimeout] to [~speechTimeout] plus [5] seconds
Start Indefinite Loop
Begin Text Compare : [{STATE_SPEECHACTIVE}] Equals '0'
Begin Date Compare : [~speechTimeout] Is Before Current Date/Time
Stop Dictation Mode
Write [Blue] '{DICTATION}' to log
End Condition - Exit when condition met
Else
Set date [~speechTimeout] value to the current date/time
Set date [~speechTimeout] to [~speechTimeout] plus [3] seconds
End Condition
End Loop
With these parameters, you have 8 seconds to start speaking (5 initial, plus the 3 from the timeout), and 3 seconds after the speech recognition engine last detects speech it'll stop the dictation and write what you said to the log.
-
A basic example for simpler, one-shot dictation (I.E. you execute the command, and as soon as the speech recognition system recognizes something, what was recognized is written to the log on the main window, and the command completes):
Start Dictation Mode (Clearing Dictation Buffer)
Start Loop While : [{DICTATION}] Equals ''
End Loop
Stop Dictation Mode
Write [Blue] '{DICTATION}' to log
-
VoiceAttack v1.10.4 or newer can utilize the "Wait For Spoken Response" action to retrieve arbitrary spoken text, without needing to use the dictation mode, or an explicit loop:
Wait for any spoken response
Write [Blue] '{TXT:~textResult}' to log
The "Responses" field is to be left blank.
If the "Timeout" value is not set to 0 or less, or left blank, after the entered value (the default being 15 seconds) has elapsed, "Not set" would be written to the log.
As the dictation buffer is specific to the dictation mode, it is not utilized here. Instead, a normal text variable will be set, and its value can be retrieved using the "{TXT:}" token, as shown.
In versions older than beta v1.10.6.14, the "Text Variable" field needs to be manually populated with the value "~textResult" (or another variable name; it just needs to match what you're using elsewhere, E.G. in the "Write a Value to the Event Log" action).