This is the Text To Speech function. It plays the given string using the Microsoft SAPI engine. The Microsoft speech engine must be installed, or this routine will return a -1. See CTI32 Guide for instructions on how to download and install.
[Visual Basic] Overloads Public Shared Function PlayTTSW( _ ByVal chdev As Integer, _ ByVal TTSstr As String, _ ByVal TermDigits As String, _ ByVal ClearDigitBuffer As Integer, _ ByVal error_file As String, _ ByVal Voice As String _ ) As TermCode
The sentence you want played out. You can also specify embedded XML Tags to change the way the speech engine produces output. Some of the tags you can specify are: For Volume Control: <volume level="nn"/> where nn is a value from 1 to 100. For Absolute Rate Of Speech: <rate absspeed="nn"/> where nn is a value from -10 to 10. For Relative Rate Of Speech: <rate speed="nn"/> where nn is a value from -10 to 10. For Absolute Pitch: <pitch absmiddle="nn"/> where nn is a value from -10 to 10. For Relative Pitch: <pitch middle="nn"/> where nn is a value from -10 to 10. For Emphasis: "The word <emph> boo </emph> is emphasized!" For Spelling Control: "The Word <spell> Spell </spell> is spelled out." For Silence Control: "Five hundred milliseconds of silence <silence msec="500"/> just occurred." Pronunciation: "<pron sym="h eh l l ow & w er l l d"/>" Bookmarks: "<bookmark mark="bookmark_one"/>Simple Text" Parts Of Speech: "<partofsp part="noun"> A </partofsp> is the first letter of the alphabet." Context: "<context id="date_mdy"> 03/04/01 </context> should be March fourth, two thousand one." Voice: "<voice required="Age=Teen">A teen should speak this sentence - if a female, non-child teen is present, she will be selected over a male teen, for example.</voice>" Language: "<voice required="Language=409">A U.S. English voice should speak this.</voice>" For More TTS Information See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/SAPI51sr/Whitepapers/WP_SimpleTTS.asp
TermDigits
This is a pointer to a string of digits that will terminate playing the file if pressed. Valid digits are 1-9 and the # and * key. For example, if you wished to terminate on the 1 key OR the # key, send the string "1#". If you pass the string "ANY", playing will be terminated upon any press of a key. Pass the empty string ("") if you wish for the file NOT to be interrupted.
ClearDigitBuffer
1 for TRUE or 0 for FALSE. If true, any digits sitting in the board's digit buffer are cleared before getting the new digits. Usually this is set to TRUE.
error_file
This is a full path to a file which speaks of a system error and a technical support number to call. This file must be a separate file and not part of a VAP file.