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)
ITextToSpeech
speak
in interface ITextToSpeech
message
- the message to speakloc
- the locale to usepublic void onDestroy()
ITextToSpeech
onDestroy
in interface ITextToSpeech
public void onStop()
ITextToSpeech
onStop
in interface ITextToSpeech
public void onResume()
ITextToSpeech
onResume
in interface ITextToSpeech
public void setPitch(float pitch)
ITextToSpeech
setPitch
in interface ITextToSpeech
pitch
- 1.0 is the normal pitch, lower values lower the tone of the synthesized voice,
greater values increase it.public void setSpeechRate(float speechRate)
ITextToSpeech
setSpeechRate
in interface ITextToSpeech
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).public void resultReturned(int requestCode, int resultCode, android.content.Intent data)
ActivityResultListener
resultReturned
in interface ActivityResultListener
requestCode
- the originally passed in request code. Used to identify the call.resultCode
- the returned result code: Activity.RESULT_OK
or
Activity.RESULT_CANCELED
data
- the returned data, encapsulated as an Intent
.public int isLanguageAvailable(java.util.Locale loc)
isLanguageAvailable
in interface ITextToSpeech
public boolean isInitialized()
isInitialized
in interface ITextToSpeech