public class UtilsTTS
extends java.lang.Object
This class implement the action to speak in high voice the phrase or the pictogram name.
Declare UtilsTTS utilTts=new UtilsTTS(Context,CustomToast,SharedPreferences);
utilsTts.preparEngineTTS();
String word="hello";
utilsTts.hablarConDialogo(world);
String word="hello";
utilsTts.hablar(world);
Modifier and Type | Field and Description |
---|---|
private CustomToast |
alerta |
private android.content.Context |
mContext |
private android.speech.tts.TextToSpeech |
mTTS |
private android.content.SharedPreferences |
sharedPrefsDefault |
private boolean |
speak |
Constructor and Description |
---|
UtilsTTS(android.content.Context mContext,
android.speech.tts.TextToSpeech mTTS,
CustomToast alerta,
android.content.SharedPreferences sharedPrefsDefault) |
Modifier and Type | Method and Description |
---|---|
android.speech.tts.TextToSpeech |
getmTTS() |
void |
hablar(java.lang.String frase)
Objetive :
Speak the phrase without dialog.
|
void |
hablarConDialogo(java.lang.String frase)
Objetive :
Speak the phrase with dialog screen.
|
boolean |
isSpeak() |
void |
preparEngineTTS()
Objetive :
Prepare the Text to Speech Engine.
|
private android.content.SharedPreferences sharedPrefsDefault
private android.speech.tts.TextToSpeech mTTS
private android.content.Context mContext
private CustomToast alerta
private boolean speak
public UtilsTTS(android.content.Context mContext, android.speech.tts.TextToSpeech mTTS, CustomToast alerta, android.content.SharedPreferences sharedPrefsDefault)
public void preparEngineTTS()
Prepare the Text to Speech Engine.
public void hablar(java.lang.String frase)
Speak the phrase without dialog.
frase
- Text to said in high voice with the TTS.public void hablarConDialogo(java.lang.String frase)
Speak the phrase with dialog screen.
frase
- Text to said in high voice with the TTS.public android.speech.tts.TextToSpeech getmTTS()
public boolean isSpeak()