public final class SimpleSpeech extends Object
SimpleSpeech.with(this).speak("hello!");
Modifier and Type | Field and Description |
---|---|
static int |
REQ_CODE_SPEECH_TO_TEXT
Request code for Intent for speech-to-text.
|
Modifier and Type | Method and Description |
---|---|
SimpleSpeech |
shutdown()
Shuts down the text-to-speech services and releases resources used.
|
SimpleSpeech |
speak(int id)
Says the given text aloud using Text-to-speech.
|
SimpleSpeech |
speak(int id,
boolean immediately)
Says the given text aloud using Text-to-speech.
|
SimpleSpeech |
speak(String text)
Says the given text aloud using Text-to-speech.
|
SimpleSpeech |
speak(String text,
boolean immediately)
Says the given text aloud using Text-to-speech.
|
SimpleSpeech |
speechToText(int promptID)
Asks the device to start recording speech and converting it to text.
|
SimpleSpeech |
speechToText(String prompt)
Asks the device to start recording speech and converting it to text.
|
boolean |
speechToTextSupported()
Returns true if the current device supports speech-to-text recognition.
|
boolean |
textToSpeechSupported()
Returns true if the current device supports text-to-speech capability.
|
static SimpleSpeech |
with(Context context)
Returns a singleton SimpleSpeech instance bound to the given context.
|
static SimpleSpeech |
with(View context)
Returns a singleton SimpleSpeech instance bound to the given view's context.
|
public static final int REQ_CODE_SPEECH_TO_TEXT
public static SimpleSpeech with(Context context)
public static SimpleSpeech with(View context)
public SimpleSpeech speak(@StringRes int id)
public SimpleSpeech speak(@StringRes int id, boolean immediately)
public SimpleSpeech speak(String text)
public SimpleSpeech speak(String text, boolean immediately)
public SimpleSpeech shutdown()
public boolean textToSpeechSupported()
public SimpleSpeech speechToText(@StringRes int promptID)
public SimpleSpeech speechToText(String prompt)
public boolean speechToTextSupported()