@Implements(android.speech.tts.TextToSpeech.class) public class ShadowTextToSpeech extends Object
Constructor | Description |
---|---|
ShadowTextToSpeech() |
@Implementation protected void __constructor__(Context context, TextToSpeech.OnInitListener listener)
@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()
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 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.@Resetter public static void clearLanguageAvailabilities()