(Obsolete)
Note: SpeechSelect is obsolete. This documentation is maintained for backward compatibility only.
Returns: Nothing
Usage: Script
Description: This statement executes in its own thread to select a text-to-speech mode on an open SAPI text-to-speech stream.
Format: SpeechSelect(SpeechHandle, GUID, WaveDevice, ErrorCode)
Parameters: SpeechHandle is the SAPI text-to-speech handle to use; this is the return value from a SpeechStream call.
GUID is any text expression giving the globally unique identifier for the text-to-speech mode to be selected for use with other SAPI text-to-speech statements. This can be a straightforward text string, assuming you know the GUID of the text-to-speech mode that you wish to use. More commonly, GUID will be one of those returned by a SpeechEnum statement
WaveDevice is any numeric expression identifying the multi-media wave output device number to be used by the text-to-speech engine to produce speech. The default value is -1 (usually a sound card). Device number to physical device assignments are system specific and are handled by the operating system.
ErrorCode is any variable that will be set to a valid value upon completion of the statement. The value of ErrorCode will be zero if no errors occurred or will be set to the low-order 16-bits of the standard Win32 error code or a SAPI text-to-speech specific error code.
Comments: This function executes in the thread created by the SpeechStream call, so it will not block other statements from executing. This does mean, however, that the timing for Result becoming valid is unpredictable and should therefore be checked for validity prior to being used.
You will require a text-to-speech engine and voices to be able to execute speech related statements.
Example:
sHandle = SpeechStream();
If Valid(sHandle) && ! selected;
[
selected = 1;
SpeechSelect(sHandle, sModes[0][0], -1, eCode);
]
If eCode == 0 Done;
If eCode != 0 ShowError;
Assuming that sModes is an array returned by a SpeechEnum statement, this will select the first available text-to-speech engine mode as the mode for the SAPI text-to-speech stream referenced by sHandle.
See Also:
SpeechEnum | SpeechLexiconDlg | SpeechReset | SpeechSpeak | SpeechStream