public class ExternalTextToSpeech extends java.lang.Object implements ITextToSpeech, ActivityResultListener
ITextToSpeech.TextToSpeechCallback| Constructor and Description |
|---|
ExternalTextToSpeech(ComponentContainer container,
ITextToSpeech.TextToSpeechCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isInitialized() |
int |
isLanguageAvailable(java.util.Locale loc) |
void |
onDestroy()
This will be called when the Activity is destroyed, to give us a chance to cleanup resources,
if necessary.
|
void |
onResume()
This will be called when the Activity is resumed, to give us a chance to re-initialize
resources, if necessary.
|
void |
onStop()
This will be called when the Activity is stopped, to give us a chance to cleanup resources,
if necessary.
|
void |
resultReturned(int requestCode,
int resultCode,
android.content.Intent data)
The callback method used to report Activity results back to the caller.
|
void |
setPitch(float pitch)
Sets the speech pitch for the TextToSpeech
|
void |
setSpeechRate(float speechRate)
Sets the speech rate
|
void |
speak(java.lang.String message,
java.util.Locale loc)
Speaks the given message corresponding to the language and country of the given locale.
|
public ExternalTextToSpeech(ComponentContainer container, ITextToSpeech.TextToSpeechCallback callback)
public void speak(java.lang.String message,
java.util.Locale loc)
ITextToSpeechspeak in interface ITextToSpeechmessage - the message to speakloc - the locale to usepublic void onDestroy()
ITextToSpeechonDestroy in interface ITextToSpeechpublic void onStop()
ITextToSpeechonStop in interface ITextToSpeechpublic void onResume()
ITextToSpeechonResume in interface ITextToSpeechpublic void setPitch(float pitch)
ITextToSpeechsetPitch in interface ITextToSpeechpitch - 1.0 is the normal pitch, lower values lower the tone of the synthesized voice,
greater values increase it.public void setSpeechRate(float speechRate)
ITextToSpeechsetSpeechRate in interface ITextToSpeechspeechRate - 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).public void resultReturned(int requestCode,
int resultCode,
android.content.Intent data)
ActivityResultListenerresultReturned in interface ActivityResultListenerrequestCode - the originally passed in request code. Used to identify the call.resultCode - the returned result code: Activity.RESULT_OK or
Activity.RESULT_CANCELEDdata - the returned data, encapsulated as an Intent.public int isLanguageAvailable(java.util.Locale loc)
isLanguageAvailable in interface ITextToSpeechpublic boolean isInitialized()
isInitialized in interface ITextToSpeech