How to check if SpeechRecognizer is currently running?

Viewed 1150

I am trying to track state of SpeechRecognizer, like that:

private SpeechRecognizer mInternalSpeechRecognizer;
private boolean mIsRecording;

public void startRecording(Intent intent) {
 mIsRecording = true;
 // ...
 mInternalSpeechRecognizer.startListening(intent);
}

Problem with that approach is keeping mIsRecording flag up to date is tough, e.g. if there's ERROR_NO_MATCH error should it be set to false or not?
I am under impression some devices stop recording then and others no.

I don't see any method like SpeechRecognizer.isRecording(context), so I am wondering if there's way to query through running services.

1 Answers
Related