AI2 Component
(Version nb184)
|
Classes | |
interface | TextToSpeechCallback |
Public Member Functions | |
void | speak (String message, Locale loc) |
void | onStop () |
void | onResume () |
void | onDestroy () |
void | setPitch (float pitch) |
void | setSpeechRate (float speechRate) |
int | isLanguageAvailable (Locale loc) |
boolean | isInitialized () |
This abstracts out what a text to speech implementation needs to have. In particular we use this to enable having an implementation that uses the internal Android TextToSpeech library for post-Donut devices and uses an externally installed library for the earlier devices.
Definition at line 19 of file ITextToSpeech.java.
boolean com.google.appinventor.components.runtime.util.ITextToSpeech.isInitialized | ( | ) |
int com.google.appinventor.components.runtime.util.ITextToSpeech.isLanguageAvailable | ( | Locale | loc | ) |
void com.google.appinventor.components.runtime.util.ITextToSpeech.onDestroy | ( | ) |
This will be called when the Activity is destroyed, to give us a chance to cleanup resources, if necessary.
Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.
void com.google.appinventor.components.runtime.util.ITextToSpeech.onResume | ( | ) |
This will be called when the Activity is resumed, to give us a chance to re-initialize resources, if necessary.
Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.
void com.google.appinventor.components.runtime.util.ITextToSpeech.onStop | ( | ) |
This will be called when the Activity is stopped, to give us a chance to cleanup resources, if necessary.
Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.
void com.google.appinventor.components.runtime.util.ITextToSpeech.setPitch | ( | float | pitch | ) |
Sets the speech pitch for the TextToSpeech
pitch | 1.0 is the normal pitch, lower values lower the tone of the synthesized voice, greater values increase it. |
Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.
void com.google.appinventor.components.runtime.util.ITextToSpeech.setSpeechRate | ( | float | speechRate | ) |
Sets the speech rate
speechRate | Speech rate. 1.0 is the normal speech rate, lower values slow down the speech (0.5 is half the normal speech rate), greater values accelerate it (2.0 is twice the normal speech rate). |
Implemented in com.google.appinventor.components.runtime.util.InternalTextToSpeech, and com.google.appinventor.components.runtime.util.ExternalTextToSpeech.
void com.google.appinventor.components.runtime.util.ITextToSpeech.speak | ( | String | message, |
Locale | loc | ||
) |
Speaks the given message corresponding to the language and country of the given locale.
message | the message to speak |
loc | the locale to use |
Implemented in com.google.appinventor.components.runtime.util.ExternalTextToSpeech, and com.google.appinventor.components.runtime.util.InternalTextToSpeech.