AI2 Component
(Version nb184)
|
Public Member Functions | |
InternalTextToSpeech (Activity activity, TextToSpeechCallback callback) | |
void | speak (final String message, final Locale loc) |
boolean | isInitialized () |
void | onStop () |
void | onDestroy () |
void | onResume () |
void | setPitch (float pitch) |
void | setSpeechRate (float speechRate) |
int | isLanguageAvailable (Locale loc) |
Wrapper class for Android's android.speech.tts.TextToSpeech class, which doesn't exist on pre-1.6 devices.
We need to wrap this because the Dalvik class loader will fail to verify a class that contains references to non-existence classes and therefore we arrange for the failure to occur in this class, rather than the component class which references this. The component class can figure out whether it wants to use this wrapper class or not depending on the SDK level.
See http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html for some more about this.
Definition at line 34 of file InternalTextToSpeech.java.
com.google.appinventor.components.runtime.util.InternalTextToSpeech.InternalTextToSpeech | ( | Activity | activity, |
TextToSpeechCallback | callback | ||
) |
Definition at line 55 of file InternalTextToSpeech.java.
boolean com.google.appinventor.components.runtime.util.InternalTextToSpeech.isInitialized | ( | ) |
Implements com.google.appinventor.components.runtime.util.ITextToSpeech.
Definition at line 81 of file InternalTextToSpeech.java.
int com.google.appinventor.components.runtime.util.InternalTextToSpeech.isLanguageAvailable | ( | Locale | loc | ) |
Implements com.google.appinventor.components.runtime.util.ITextToSpeech.
Definition at line 163 of file InternalTextToSpeech.java.
void com.google.appinventor.components.runtime.util.InternalTextToSpeech.onDestroy | ( | ) |
This will be called when the Activity is destroyed, to give us a chance to cleanup resources, if necessary.
Implements com.google.appinventor.components.runtime.util.ITextToSpeech.
Definition at line 137 of file InternalTextToSpeech.java.
void com.google.appinventor.components.runtime.util.InternalTextToSpeech.onResume | ( | ) |
This will be called when the Activity is resumed, to give us a chance to re-initialize resources, if necessary.
Implements com.google.appinventor.components.runtime.util.ITextToSpeech.
Definition at line 147 of file InternalTextToSpeech.java.
void com.google.appinventor.components.runtime.util.InternalTextToSpeech.onStop | ( | ) |
This will be called when the Activity is stopped, to give us a chance to cleanup resources, if necessary.
Implements com.google.appinventor.components.runtime.util.ITextToSpeech.
Definition at line 131 of file InternalTextToSpeech.java.
void com.google.appinventor.components.runtime.util.InternalTextToSpeech.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. |
Implements com.google.appinventor.components.runtime.util.ITextToSpeech.
Definition at line 153 of file InternalTextToSpeech.java.
void com.google.appinventor.components.runtime.util.InternalTextToSpeech.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). |
Implements com.google.appinventor.components.runtime.util.ITextToSpeech.
Definition at line 158 of file InternalTextToSpeech.java.
void com.google.appinventor.components.runtime.util.InternalTextToSpeech.speak | ( | final String | message, |
final 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 |
Implements com.google.appinventor.components.runtime.util.ITextToSpeech.
Definition at line 76 of file InternalTextToSpeech.java.