Package org.robolectric.shadows
Class ShadowSpeechRecognizer
java.lang.Object
org.robolectric.shadows.ShadowSpeechRecognizer
@Implements(android.speech.SpeechRecognizer.class) public class ShadowSpeechRecognizer extends Object
Robolectric shadow for SpeechRecognizer.
-
Constructor Summary
Constructors Constructor Description ShadowSpeechRecognizer()
-
Method Summary
Modifier and Type Method Description protected static SpeechRecognizer
createSpeechRecognizer(Context context, ComponentName serviceComponent)
static SpeechRecognizer
getLatestSpeechRecognizer()
Returns the latest SpeechRecognizer.protected void
handleChangeListener(RecognitionListener listener)
Handles changing the listener and allows access to the internal listener to trigger events and sets the latest SpeechRecognizer.static void
reset()
protected void
startListening(Intent recognizerIntent)
void
triggerOnEndOfSpeech()
void
triggerOnError(int error)
void
triggerOnPartialResults(Bundle bundle)
void
triggerOnResults(Bundle bundle)
void
triggerOnRmsChanged(float rmsdB)
-
Constructor Details
-
ShadowSpeechRecognizer
public ShadowSpeechRecognizer()
-
-
Method Details
-
getLatestSpeechRecognizer
Returns the latest SpeechRecognizer. This method can only be called afterSpeechRecognizer#createSpeechRecognizer()
is called. -
reset
-
createSpeechRecognizer
@Implementation protected static SpeechRecognizer createSpeechRecognizer(Context context, ComponentName serviceComponent) -
startListening
-
handleChangeListener
Handles changing the listener and allows access to the internal listener to trigger events and sets the latest SpeechRecognizer. -
triggerOnEndOfSpeech
public void triggerOnEndOfSpeech() -
triggerOnError
public void triggerOnError(int error) -
triggerOnPartialResults
-
triggerOnResults
-
triggerOnRmsChanged
public void triggerOnRmsChanged(float rmsdB)
-