GetVoices

(VoiceTalk Module)

Description: Runs in the VoiceTalk thread and returns a list of voices available on a SAPI text-to-speech stream.
Returns: Array
Usage: Script Only.
Function Groups: Speech and Sound
Related to: Configure | GetDevices | Reset | ShowLexicon | Speak | VoiceTalk
Format: VoiceTalkStream\GetVoices([Detailed])
Parameters:  
Detailed
Optional. A flag which, if set to a non-zero value, results in a detailed 2-dimensional array of information about the voices being returned. If this parameter is "0" or omitted, the return value will be a 1-dimensional list of voice names suitable for use in the VoiceTalk\Configure function.
If Detailed is specified, a 2-dimensional array containing the available speech voices will be returned. Each row in the array represents a speech module as follows:

[N][0]  Text value that indicates the name of this voice This is a human readable string (such as "Microsoft Mary") that may be passed to the VoiceTalk\Configure function.

[N][1]  Text value giving the language of the voice. For example, American English will be returned as "409,9", where 409 is the hexadecimal representation of standard English (decimal 1033), and 9 indicates American version of English.

[N][2]  Text value giving the gender of the voice. Either "Male" or "Female"

[N][3]  Text value giving the age of the voice (e.g., "Adult")

[N][4]  Text value vendor providing the voice (e.g. "Microsoft")
Comments

VoiceTalkStream is a speech stream returned from VoiceTalk.

This function will return immediately. 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.

Example:

  SHandle = \VoiceTalk();
  If Valid(SHandle) && ! GetVoices;
  [
    GetVoices = 1;
    SVoices = SHandle\GetVoices(1);
  ]

This will return a detailed 2-dimensional array of all available text-to-speech engine voices in the array, SVoices.