5

My Android app (Xamarin) uses speech recognition. This has worked fine on smartphones with Android 8, 11 and 12. Since a few weeks the speech recognition of my app has stopped working with Android 11 (2 different smartphones tested). It still works fine under Android 8 + 12! The Gboard speech recognition still works on Android 11. There are no updates on my smartphone with Android 11 and also no updates of my app.

OnResults was always called from SpeechRecognizer with the recognized text before. Now, OnResults is called with empty Bundle. OnError is called with SpeechRecognizerError.NoMatch.

If I use an Intent for speech recognition, it works! If I use the SpeechRecognizer with the same parameters, it does not work. I have to use the SpeechRecognizer because I do not want the Android dialog in my app.

So what is different when using SpeechRecognizer?

Logcat:

With Intent only

04-29 12:25:07.004 24526 24672 I A       : TTL (0 seconds) reached - destroy SODA
04-29 12:25:07.007   961   961 D sound_trigger_platform: platform_stdev_check_and_update_concurrency: concurrency active 0, tx 0, rx 0, concurrency session_allowed 1
04-29 12:25:07.009 24526 24667 I A       : Received a final result for a segment
04-29 12:25:07.009 24526 24667 I A       : Received the final result for the recognition
04-29 12:25:07.010 24526 24690 I A       : updated TranscriptionState: TranscriptionState{language=Deutsch (Deutschland), liveTranscription=# com.google.android.apps.search.transcription.f.ay@72c8abf5, finalRecognitionResults=# com.google.android.apps.search.transcription.f.o@c09c735a, hasStartOfSpeech=true, isMicOpen=true, appflowErrorStatus=null, speechLevel=0, audioUri=, lastAudioRationaleToastTimestampLoaded=false} for request-id 1191836547
04-29 12:25:07.010  1477  2981 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
04-29 12:25:07.010 24526 24526 I A       : #setLatestRecognizedText stableText: Hallo, pendingText: 
04-29 12:25:07.010  1477 27263 I SoundTriggerMiddlewareLogging: setCaptureState[this=com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareImpl@51cdb90, caller=1041/1059](false)
04-29 12:25:07.010 24526 24690 I A       : Offline recognizer - stop detection
04-29 12:25:07.014  1477  2981 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
04-29 12:25:07.014  1477  2981 I chatty  : uid=1000(system) Binder:1477_14 identical 1 line
04-29 12:25:07.015  1477  2981 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
04-29 12:25:07.015 24629 24680 I A       : AudioRequestListeningSession stop listening status: CLOSED

With SpeechRecognizer

04-29 12:28:07.216 24526 24690 I A       : TTL (0 seconds) reached - destroy SODA
04-29 12:28:07.224  1477  2951 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
04-29 12:28:07.246   961 17127 D audio_hw_primary: disable_audio_route: usecase(10) reset and update mixer path: audio-record
04-29 12:28:07.247   961 17127 I soundtrigger: audio_extn_sound_trigger_update_stream_status: send event 12: usecase id 10, type 1
04-29 12:28:07.247   961 17127 D sound_trigger_platform: platform_stdev_check_and_update_concurrency: concurrency active 0, tx 1, rx 0, concurrency session_allowed 1
04-29 12:28:07.247   961 17127 D sound_trigger_platform: platform_stdev_check_concurrency_supported: capture concurrency  allowed, usecase type 1 voice_concur 0 voip_concur 0
04-29 12:28:07.247   961 17127 D audio_hw_primary: disable_snd_device: snd_device(84: voice-rec-mic)
04-29 12:28:07.251   961 17127 D sound_trigger_platform: platform_stdev_check_and_update_concurrency: concurrency active 0, tx 0, rx 0, concurrency session_allowed 1
04-29 12:28:07.254  1477  2951 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
04-29 12:28:07.254  1477  5904 I SoundTriggerMiddlewareLogging: setCaptureState[this=com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareImpl@51cdb90, caller=1041/1059](false)
04-29 12:28:07.260  1477  5904 I SoundTriggerMiddlewareLogging: setCaptureState[this=com.android.server.soundtrigger_middleware.SoundTriggerMiddlewareImpl@51cdb90, caller=1041/1059](false)
04-29 12:28:07.261  1477  8707 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4
04-29 12:28:07.261 24629 24679 I A       : AudioRequestListeningSession stop listening status: CLOSED

Some details of AndroidManifest.xml:

android:versionCode="30"
android:targetSdkVersion="30" 
android:minSdkVersion="22"

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<queries>
    <intent>
        <action android:name="android.speech.RecognitionService" />
    </intent>
</queries>

Thanks a lot and have a nice day,

3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Apr 22, 2022 at 14:01
  • 1
    check if it's not the same problem here: stackoverflow.com/questions/71869811/…
    – LM_IT
    Commented May 5, 2022 at 8:17
  • It is the same problem. Thanks a lot!
    – uli1306
    Commented May 6, 2022 at 12:51

2 Answers 2

7

This error is a combination of the Google app update 13.16.8.23.arm64 and some intent parameters usage.

If the following parameters are set

RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS
RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS 
RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS

AND

the latest Google app is installed, the SpeechRecognizer will not work.

If the latest Google app was uninstalled (which will roll back to the older version), the SpeechRecognizer works again, even with this parameters.

If the parameters are removed from code, the SpeechRecognizer works fine, even with the latest Google app.

1
  • 1
    This has been a major issue for our users. I removed the parameters as suggested and confirm that it works properly now. It does not give the user as much time to complete their sentences, which will be a problem for some of our disabled and older users. But this is much better than having it totally unusable. Commented Aug 8, 2022 at 2:00
6

Try to remove from your intent one or all of the following:

RecognizerIntent.EXTRA_MAX_RESULTS RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS RecognizerIntent.EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS

In my case I had to remove all of 'em otherwise it would not work

4
  • Not sure why this has stopped working.
    – vishalk
    Commented Jun 21, 2022 at 13:07
  • Hi @vishalk, you mean that now even w/out those options the speechRecognizer is not working? Could you share a little more about the error?
    – LM_IT
    Commented Jun 21, 2022 at 15:09
  • One of the solutions worked for us. But we are wondering why this stopped working with the latest updates from Google. As there is no official documentation on this update and affected features from Google.
    – vishalk
    Commented Jun 22, 2022 at 4:22
  • As far as I understood 'till now it probably could be related with Google's new recognition engine. In fact in some devices w/ Android 12 you have to force programmatically the engine to be used, otherwise it'll not work
    – LM_IT
    Commented Jun 23, 2022 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.