@Implements(android.speech.tts.TextToSpeech.class) public class ShadowTextToSpeech extends Object
Constructor | Description |
---|---|
ShadowTextToSpeech() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
__constructor__(Context context,
TextToSpeech.OnInitListener listener,
String engine,
String packageName,
boolean useFallback) |
|
static void |
addLanguageAvailability(Locale locale) |
Makes
Locale an available language returned by TextToSpeech.isLanguageAvailable(Locale) . |
static void |
addVoice(Voice voice) |
Makes
Voice an available voice returned by TextToSpeech.getVoices() . |
void |
clearLastSpokenText() |
|
Context |
getContext() |
|
Locale |
getCurrentLanguage() |
Returns
Locale set using TextToSpeech.setLanguage(Locale) or null if not set. |
Voice |
getCurrentVoice() |
Returns
Voice set using TextToSpeech.setVoice(Voice) , or null if not set. |
String |
getLastSpokenText() |
|
String |
getLastSynthesizeToFileText() |
Returns last text
CharSequence passed to TextToSpeech.synthesizeToFile(CharSequence, Bundle, File, String) . |
static TextToSpeech |
getLastTextToSpeechInstance() |
Returns the most recently instantiated
TextToSpeech or null if none exist. |
TextToSpeech.OnInitListener |
getOnInitListener() |
|
int |
getQueueMode() |
|
com.google.common.collect.ImmutableList<String> |
getSpokenTextList() |
Returns list of all the text spoken by
speak(java.lang.String, int, java.util.HashMap<java.lang.String, java.lang.String>) . |
UtteranceProgressListener |
getUtteranceProgressListener() |
|
protected Set<Voice> |
getVoices() |
|
protected int |
initTts() |
|
protected int |
isLanguageAvailable(Locale lang) |
|
boolean |
isShutdown() |
|
boolean |
isStopped() |
|
static void |
reset() |
|
protected int |
setLanguage(Locale locale) |
|
protected int |
setVoice(Voice voice) |
|
protected void |
shutdown() |
|
protected int |
speak(CharSequence text,
int queueMode,
Bundle params,
String utteranceId) |
|
protected int |
speak(String text,
int queueMode,
HashMap<String,String> params) |
Speaks the string using the specified queuing strategy and speech parameters.
|
protected int |
stop() |
|
protected int |
synthesizeToFile(CharSequence text,
Bundle params,
File file,
String utteranceId) |
Stores
text and returns TextToSpeech.SUCCESS . |
@Implementation protected void __constructor__(Context context, TextToSpeech.OnInitListener listener, String engine, String packageName, boolean useFallback)
@Implementation protected int initTts()
@Implementation protected int speak(String text, int queueMode, HashMap<String,String> params)
params
- The real implementation converts the hashmap into a bundle, but the bundle
argument is not used in the shadow implementation.@Implementation(minSdk=21) protected int speak(CharSequence text, int queueMode, Bundle params, String utteranceId)
@Implementation protected void shutdown()
@Implementation protected int stop()
@Implementation protected int isLanguageAvailable(Locale lang)
@Implementation protected int setLanguage(Locale locale)
@Implementation(minSdk=21) protected int synthesizeToFile(CharSequence text, Bundle params, File file, String utteranceId)
text
and returns TextToSpeech.SUCCESS
.getLastSynthesizeToFileText()
@Implementation(minSdk=21) protected int setVoice(Voice voice)
@Implementation(minSdk=21) protected Set<Voice> getVoices()
public UtteranceProgressListener getUtteranceProgressListener()
public Context getContext()
public TextToSpeech.OnInitListener getOnInitListener()
public String getLastSpokenText()
public void clearLastSpokenText()
public boolean isShutdown()
public boolean isStopped()
true
if the TTS is stopped.public int getQueueMode()
public Locale getCurrentLanguage()
Locale
set using TextToSpeech.setLanguage(Locale)
or null if not set.public String getLastSynthesizeToFileText()
CharSequence
passed to TextToSpeech.synthesizeToFile(CharSequence, Bundle, File, String)
.public com.google.common.collect.ImmutableList<String> getSpokenTextList()
speak(java.lang.String, int, java.util.HashMap<java.lang.String, java.lang.String>)
.public static void addLanguageAvailability(Locale locale)
Locale
an available language returned by TextToSpeech.isLanguageAvailable(Locale)
. The value returned by isLanguageAvailable(Locale)
will vary depending on language, country, and variant.public static void addVoice(Voice voice)
Voice
an available voice returned by TextToSpeech.getVoices()
.public Voice getCurrentVoice()
Voice
set using TextToSpeech.setVoice(Voice)
, or null if not set.public static TextToSpeech getLastTextToSpeechInstance()
TextToSpeech
or null if none exist.@Resetter public static void reset()