SpeechRecognizer throws ERROR_NO_MATCH on first li

2019-09-12 00:24发布

The behavior is very similar to what is described here, but only happens when the googlequicksearchbox is in the background. I'm with Google APP 5.2.33.19.arm.

I created the SpeechRecognizer by calling

SpeechRecognizer.createSpeechRecognizer(myContext, new ComponentName("com.google.android.googlequicksearchbox", "com.google.android.voicesearch.serviceapi.GoogleRecognitionService"))

I got the following error message in Android Studio Logcat

GoogleRecognitionServic﹕ #startListening [es-MX]
WebAppState﹕ WebApp unloaded
MediaFocusControl﹕ AudioFocus  requestAudioFocus() from android.media.AudioManager@b4542c6com.google.android.voicesearch.a.a$1@11f9f287 req=4flags=0x0
MediaFocusControl﹕ AudioFocus  abandonAudioFocus() from android.media.AudioManager@b4542c6com.google.android.voicesearch.a.a$1@11f9f287
Greco3EngineManager﹕ create_rm: m=ENDPOINTER_DICTATION,l=en-US
Greco3EngineManager﹕ Brought up new g3 instance :/system/usr/srec/en-US/endpointer_dictation.config for: en-USin: 1 ms
ErrorReporter﹕ reportError [type: 211, code: 458760]: es-MX
ErrorProcessor﹕ onFatalError, ignoring error from engine(1): com.google.android.apps.gsa.shared.speech.a.f: es-MX
ErrorReporter﹕ reportError [type: 211, code: 458756]: GsaErrorCode: 458756, engine: 1
ErrorProcessor﹕ onFatalError, ignoring error from engine(1): com.google.android.apps.gsa.shared.speech.a.d: GsaErrorCode: 458756, engine: 1
GoogleSpeechRecognition﹕ onError No match

Here is the entire messages from the speech recognizer. There is also an ERROR_CLIENT near finish. Another thing is there is no onRmsChanged call when this happens. Usually, there are tons of this call during a normal recognition request.

googleRecognizer﹕ onError No match
googleRecognizer﹕ onReadyForSpeech
googleRecognizer﹕ onBeginningOfSpeech
googleRecognizer﹕ onPartialResults
googleRecognizer﹕ onPartialResults
googleRecognizer﹕ onPartialResults
googleRecognizer﹕ onPartialResults
googleRecognizer﹕ onPartialResults
googleRecognizer﹕ onEndOfSpeech
googleRecognizer﹕ onError Client side error
googleRecognizer﹕ onResults

1条回答
再贱就再见
2楼-- · 2019-09-12 00:49

You need to first understand what the SpeechRecognizer does. The SpeechRecognizer sends a "waking call" to your default speech to text application on your phone ( This can be seeing on Settings->Language and Input ). The default app wakes up, converts your speech to text and then sends it back to you onResults. In your specific case, you are explicitly calling 'google search'.

SpeechRecognizer.createSpeechRecognizer(..."com.google.android.googlequicksearchbox"...)

I would say that while 'googlequicksearchbox' is running in the background your recognizer fails to uses it (Since there can be only one instance of this action) .

Try calling a different speech to text app, and see what happens.

查看更多
登录 后发表回答