SpeechEnum 

                        (Obsolete)

Note: SpeechEnum is obsolete. This documentation is maintained for backward compatibility only.

Description:              This statement executes in its own thread to enumerate the pool of speech modes available on a SAPI text-to-speech stream.

Returns:                    Nothing

Usage:                   Script

Format:                      SpeechEnum(SpeechHandle, Result, ErrorCode)

Parameters:             SpeechHandle is the SAPI text-to-speech handle to use; this is the return value from a SpeechStream call.

                                    Result is any variable in which the resulting 2 dimensional array containing the available speech modes will be stored. Each row in the array represents a speech mode as follows:

                             Element Information

                             [N][0] Text value that indicates the GUID that uniquely identifies this mode (this is required by the SpeechSelect statement)

                             [N][1] Text value giving the name of the speech engine that is able to run this mode (e.g. "Microsoft Speech Synthesis Engine")

                             [N][2] Text value giving the name of the mode (e.g. "Mary in a space suit")

                             [N][3] Integer value that is the Win32 language code of the speaker

                             [N][4] Text value indicating the name of the speaker (e.g. "Default female voice")

                             [N][5] Text value indicating the style of the speaker (e.g. "Clear low-accented North American English native")

                             [N][6] Integer value indicating the gender of the speaker, where 0 = child, 1 = female, and 2 = male

                             [N][7] Integer value giving the age of the speaker

                             [N][8] Text value indicating the dialect of the speaker

                             [N][9] Text value indicating the manufacturer of this mode

                             [N][10] Integer value indicating various properties of the mode (see Comments below).

                                    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 ErrorCode should therefore be checked for validity prior to Result being used.

                             Using the array information returned from this call, it is possible to determine whether a particular SAPI text-to-speech mode exists on the system. If it does not, the array information can be used to select the voice that most closely matches the desired characteristics, or build and display a dialog to allow the user to choose.

                             Element 10 of Result is a bit-significant list of mode features. The bits which are of interest here are:

                                    Bit 8: Voice is optimized to work through a computer sound card

                                    Bit 9: Voice is optimized for telephony applications

                             You will require a text-to-speech engine and voices to be able to execute speech related statements.

Example:

sHandle = SpeechStream();

If Valid(sHandle) && ! getModes;

[

  getModes = 1; 

  SpeechEnum(sHandle, sModes, eCode); 

]

If eCode == 0 ShowModes;

If eCode != 0 ShowError;

This will return all available text-to-speech engine modes in array sModes and change to state ShowModes if successful or state ShowError if not.

See Also:

SpeechLexiconDlg | SpeechReset | SpeechSelect | SpeechSpeak | SpeechStream