pbakondy / cordova-plugin-speechrecognition

:microphone: Cordova Plugin for Speech Recognition
MIT License
197 stars 117 forks source link

recognition not working with android 12 #119

Open markenapps opened 2 years ago

markenapps commented 2 years ago

Hi There.

cordova 9.1.0

When starting recognition with these options

  {
      language: "de",
      matches: 1,
      prompt: "",    
      showPopup: false, 
      showPartial: true
  }

This error is raised instantly: "Didn't understand, please try again."

May be caused by showPartial=true?

Any hints or solutions please.

joshglazer commented 2 years ago

I ran into the same problem with my app after upgrading a Pixel 3a to Android 12. I found a workaround here: https://stackoverflow.com/questions/69827554/why-did-my-android-app-using-speechrecognizer-stop-working-after-upgrading-to-an

I chose to fix this by following these directions:

This can be fixed by the user of the device, by going into Settings > Apps > Default apps > Digital assistant app > Voice input and changing it back to "Speech services by Google" (you may first need to update Speech services by Google via the Play Store). Once this is done, Android System Intelligence will disappear from the list of options in that setting, suggesting it was never intended to be chosen in the first place.

The article linked above also mentions another possible workaround that could be made to the initialize function (https://github.com/pbakondy/cordova-plugin-speechrecognition/blob/master/src/android/com/pbakondy/SpeechRecognition.java#L72) but that change is not recommended by the author of the article. The author also mentioned that this is most likely a bug in the Android operating system, so I'm hoping it gets fixed in a future release (something similar happened for iOS a few years ago, the problem cleared up on it's own after apple released a new version of iOS).

markenapps commented 2 years ago

thanks for the hint @joshglazer