VoiceTalk
(VTScada-Layer function. Must be called with a leading backslash.)
Description: | Opens and returns a handle to a SAPI text-to-speech stream. |
Returns: | Stream handle |
Usage: | Steady State only. |
Function Groups: | Speech and Sound |
Related to: | Configure | GetDevices | GetVoices | Reset | ShowLexicon | Speak |
Format: | \VoiceTalk([SpeakCount, BookmarkNum]) |
Parameters: |
SpeakCount |
An optional parameter that is any variable in which the number of outstanding VoiceTalk\Speak requests (those that have not yet finished speaking) on this stream will be maintained. When this parameter is set to zero, this SAPI text-to-speech stream is not speaking (i.e. it is initially set to zero). If this parameter is omitted or Invalid, no speak count will be maintained. Note that SAPI could still be speaking on another stream when this count is zero on one stream. |
BookmarkNum |
An optional parameter that is any variable that will be set to the value of the last text bookmark encountered by the speech engine on this stream (a bookmark is denoted by the XML tag <BOOKMARK MARK="bookmark"/>). It is initially set to Invalid. |
Comments: | This function returns the error code resulting from issuing the command to the speech engine, or zero if no error was encountered. This function is not threaded, however, it creates a thread inside of which the handle referring to the text-to-speech stream is accessed. All other speech functions on this stream do not create their own thread, but will execute in the thread created by this function. This thread will exist for as long as the VoiceTalk statement remains active (i.e. until a state change occurs). For this reason, the state containing the VoiceTalk call must remain active until all other speech statements have finished executing. There can be multiple SAPI text-to-speech streams open at any time. |
Example:
speechHandle = \VoiceTalk();
This will create a SAPI text-to-speech stream that will maintain neither speak count nor bookmark positions.
speechHandle = \VoiceTalk(sCount, bNum);
This will create a SAPI text-to-speech stream that will maintain both a speak count and bookmark positions.
speechHandle = \VoiceTalk(invalid, bNum);
This will create a SAPI text-to-speech stream that will maintain bookmark positions only.
The following list consists of the methods that a VoiceTalk stream provides for external use.