A TextToSpeech object
represents a string which is to be spoken using synthesized speech
in a specific locale. You must have Text-To-Speech technology
configured on the telephony server in order to use this class.
The string to be synthesized is represented by the ttsString property
in the form of a java.lang.String object.
The constructor methods for this class are:
- TextToSpeech()
- Constructs a text to speech object with an empty string and default
locale (the application locale or the node locale depending on how
you are running the application). You can set these properties later
using the methods setTtsString() and setLocale().
- TextToSpeech(java.lang.String ttsString)
- Constructs a text to speech object with specified text and default
locale.
- TextToSpeech(java.lang.String ttsString, java.util.Locale locale)
- Constructs a text to speech object with specified text and locale.
For example, a weather forecast application might ask
a caller to input their geographical location using speech recognition.
Rather than repeat the recorded input string to the caller to confirm
their location, the application could use text-to-speech to play the
output string (
townString) from the recognizer. The
following example shows how to declare the
TextToSpeech object:
public class InApp extends WVRApplication {
.
.
.
// Create the TextToSpeech object
public TextToSpeech ttsTown = new TextToSpeech(townString);
.
.
.
}