say (ctype.src)
The say instruction is used by the Text-to-Speech (TTS) feature to direct the system to speak ASCII text stored in a buffer. The argument ctype.src is the ASCII text string to be spoken. The script may pass text as a literally quoted string or the contents of a null-terminated field (for example, previously populated with a call to the dbase instruction). The maximum length of a literal string is 2048 characters.
The say instruction is similar to the talk instruction used for phrases of coded speech. The text passed to say is stored in a buffer that holds up to 2048 bytes of text. This buffer is flushed and the text is played when the buffer is full and another say instruction is executed or when any wait-causing instruction is executed.
The tflush instruction may be used to flush the text-to-speech buffer and cause the text to play. The first two arguments to tflush, the must_hear_flag and the wait_indicator, have the same effect for TTS as for coded speech. The third argument to tflush, the remember_flag, is not used for TTS. That is, the first argument may be used to disable talkoff and the second may be used to play speech and to continue the script without waiting for the play to complete. Normally, TSM waits for a TTS play to complete before going to the next instruction. Spinning off a TTS play, then executing dbase to get the next block of text while the first block is playing avoids a delay in play between the two blocks of text. Scripts may continue executing alternate say, tflush, and dbase calls in this manner until all the text from a DIP is passed to say to be played.
The say instruction returns one of following values in script register 0 (r.0):
Return Value |
Return Explanation |
0 |
The instruction completed successfully. |
-1 |
The say instruction failed. This happens if the text passed to say did not fit into one TTS buffer (2048 bytes). |
As with coded speech, any TTS being played stops when the script that caused it terminates or executes a tstop instruction.
fsay(ctype.src)
The fsay instruction is similar to the say instruction, however it instructs the system to speak ASCII text stored in a file instead of a buffer.
The ctype.src argument specifies the fully qualified or relative pathname of a file of ASCII text to be spoken. The script may pass the pathname as a literally quoted string, or the contents of a null-terminated field. The maximum length of the pathname is 128 characters. There is no limit to the size of the file itself.
Note:
The fsay instruction should be used for speaking large blocks of text instead of using ttsdip.
The tflush instruction may be used to flush the TTS speech and cause the text to be spoken. The first two arguments to tflush, the must_hear_flag and the wait_indicator, have the same effect for text-to-speech as for coded speech. The third argument to tflush, the remember_flag, is not used for TTS. That is, the first argument may be used to disable talkoff and the second may be used to play speech and to continue the script without waiting for the play to complete. Normally, TSM waits for a TTS play to complete before going on to the next instruction.
As shown in the following table, the fsay instruction returns one of the following values in script register 0 (r.0).
Return Value |
Return Explanation |
0 |
The fsay instruction completed successfully |
-1 |
The fsay instruction failed to queue the request |
-2 |
One of the following has occurred:
A relative pathname was passed in and the length of the prepend directory plus the length of the relative pathname was too large. |