public class AndroidTextToSpeech
extends java.lang.Object
Constructor and Description |
---|
AndroidTextToSpeech() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Shuts down the TextToSpeech engine.
|
java.lang.String |
getCountryCode()
Returns the current country code.
|
java.lang.String |
getLanguageCode()
Returns the current language code.
|
java.lang.String |
getStatus()
Returns the TextToSpeech initialization status.
|
void |
initialize()
Initialize the TextToSpeech engine.
|
boolean |
isLanguageAndCountryAvailable(java.lang.String languageCode,
java.lang.String countryCode)
Returns true if the given language is supported.
|
boolean |
isLanguageAvailable(java.lang.String languageCode)
Returns true if the given language is supported.
|
boolean |
isSpeaking()
Returns true if the TextToSpeech engine is busy speaking.
|
void |
setLanguage(java.lang.String languageCode)
Sets the language.
|
void |
setLanguageAndCountry(java.lang.String languageCode,
java.lang.String countryCode)
Sets the language and country.
|
void |
setPitch(float pitch)
Sets the speech pitch.
|
void |
setSpeechRate(float speechRate)
Sets the speech rate.
|
void |
speak(java.lang.String text)
Speaks the given text.
|
public void initialize()
public java.lang.String getStatus()
public java.lang.String getLanguageCode()
java.lang.IllegalStateException
- if initialized has not been called yet.public java.lang.String getCountryCode()
java.lang.IllegalStateException
- if initialized has not been called yet.public boolean isSpeaking()
java.lang.IllegalStateException
- if initialized has not been called yet.public void setPitch(float pitch)
java.lang.IllegalStateException
- if initialized has not been called yet.public void setSpeechRate(float speechRate)
java.lang.IllegalStateException
- if initialized has not been called yet.public boolean isLanguageAvailable(java.lang.String languageCode)
java.lang.IllegalStateException
- if initialized has not been called yet.public boolean isLanguageAndCountryAvailable(java.lang.String languageCode, java.lang.String countryCode)
java.lang.IllegalStateException
- if initialized has not been called yet.public void setLanguage(java.lang.String languageCode)
java.lang.IllegalStateException
- if initialized has not been called yet.public void setLanguageAndCountry(java.lang.String languageCode, java.lang.String countryCode)
java.lang.IllegalStateException
- if initialized has not been called yet.public void speak(java.lang.String text)
java.lang.IllegalStateException
- if initialized has not been called yet.public void close()