SpeechRecognizer with Google Search version 3.6.14.1337016 can't recognize other voice language except default

北城以北 提交于 2019-11-28 08:41:05

Even though this is not documented anywhere, I've been able to find out that, with the introduction of multilanguage support in its last update, Google Search is now taking a new extra in RecognizerIntent called "android.speech.extra.EXTRA_ADDITIONAL_LANGUAGES". As suggested by its name, it is a string array that would be used to specify other languages in addition to the main one, which would still be given by RecognizerIntent.EXTRA_LANGUAGE. The problem is that Google Search ignores RecognizerIntent.EXTRA_LANGUAGE if this new extra is not given along with it. This means that adding the following line to your code is enough to solve the problem:

intent.putExtra("android.speech.extra.EXTRA_ADDITIONAL_LANGUAGES", new String[]{});

But please note that, even though this works, it doesn't change the fact that there is a bug in Google Search. As I've said before, this new extra is not documented anywhere, and Google Search is not following the specification of Android's speech recognition API. As the developer of both Google Search and Android, Google should therefore either:

  1. Change the specification of the speech recognition API in Android, but this would break backward compatibility.

  2. Update the Google Search app so that it correctly follows the current specification.

The second option is obviously the most logical one, and we should therefore let Google know about the bug so that they fix it. It looks like the official Google Search Help Forum is the right place to do this, but so far nobody from Google has paid attention to the thread I created there for it (https://productforums.google.com/forum/#!topic/websearch/PUjEPmdSzSE/discussion). So if you have had this issue please post your complains there to grab Google's attention, and let's see if we get an official answer this way.

I found the same problem with my application.

I just try.

  1. Remove Google Search 3.6 update. It's work.
  2. Change the default language. I can use only a default language.

I'm waiting for Google update again.

Here is the Issue for this case: https://code.google.com/p/android/issues/detail?id=75347

Link on support site: https://productforums.google.com/d/topic/websearch/PUjEPmdSzSE/discussion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!