Original Author Paul Laughton, 2011
Page 139
De Re BASIC!
STT.results should be executed next.
Note: STT.listen is not to be used in HTML mode.
STT.results <string_list_ptr_nexp>
The command must not be executed until after a STT.listen is executed (unless in HTML mode).
The recognizer returns several variations of what it thinks it heard as a list of strings. The first string in
the list is the best guess.
The strings are written into the list that <string_list_ptr_nexp> points to. The previous contents of the
list are discarded. If the pointer does not specify a valid string list, and the expression is a numeric
variable, a new list is created and the variable is set to point to the new list.
Console Mode
The following code illustrates the command in Output Console (not HTML mode and not Graphics
mode):
PRINT "Starting Recognizer"
STT.LISTEN
STT.RESULTS theList
LIST.SIZE theList, theSize
FOR k = 1 TO theSize
LIST.GET theList, k, theText$
PRINT theText$
NEXT k
END
Graphics Mode
This command sequence is to be used in graphics mode. Graphics mode exists after Gr.open and before
Gr.close. (Note: Graphics mode is temporarily exited after Gr.front 0. Use the Console Mode if you have
called Gr.front 0).
The primary difference is that Gr.render must be called after STT.listen and before STT.results.
PRINT "Starting Recognizer"
STT.LISTEN
GR.RENDER
STT.RESULTS theList
LIST.SIZE theList, theSize
FOR k =1 TO theSize
LIST.GET theList, k, theText$
PRINT theText$
NEXT k
END