分类: C/C++
2008-03-12 00:10:24
The tchars instruction speaks phrases from a variable name.
Synopsis
tchars(ctype.src{ [,
'inflection'],[type.style]})
Description
The tchars instruction puts the null terminated string of alphanumeric characters that are identified by the first argument into a queue for speaking. The second argument, when specified, controls the speech inflection. The three inflection parameters are r (rising), f (falling), and t (total). Total produces both a rising inflection on the first phrase and a falling inflection on the last phrase if there is more than one. It produces a falling inflection if there is only one phrase. It is important to note that r, f, and t work only if those types of phrases are in the talkfile.
The optional type.style argument specifies the coding style.
The tchars instruction speaks one character at a time, unlike the tnum instruction, which speaks the digits as one number. For example, the tchars instruction would speak the number 61 as "six-one" while the tnum instruction would speak "sixty-one." Also, tchars speaks the string 61A as "six-one-A."
Example
In the following example, the script asks the caller to enter his or her ID number. The script waits for three touch tones, which it stores in ch.ID. The script then repeats what the caller entered, reading the value in ch.ID.
talk("Please enter your ID number")
getinput(ch.ID,3)
talk("Your ID number is")
tchars(ch.ID)
tflush()