Android SpeechRecognizer set recognize engine?

五迷三道 提交于 2019-12-06 11:56:53

问题


I'm using SpeechRecognizer to convert speech to text. I'm using Samsung and I encounterd error while I set Voice recognizer to 'Samsung powered by Vlingo', after I changed to 'Google' and the error disappear. I was wondering is there any method to change recognize engine programmatically? Thanks.


回答1:


I've found the answer of my question. I can use 'public static SpeechRecognizer createSpeechRecognizer (Context context, ComponentName serviceComponent)' the method to choose which recognition service to bind.

Here is the implementation.

SpeechRecognizer.createSpeechRecognizer(mContext, ComponentName.unflattenFromString("com.google.android.googlequicksearchbox/com.google.android.voicesearch.serviceapi.GoogleRecognitionService"));

Thank you all.



来源:https://stackoverflow.com/questions/27350825/android-speechrecognizer-set-recognize-engine

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