Android SpeechRecognizer set recognize engine?

2019-04-13 15:47发布

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条回答
Bombasti
2楼-- · 2019-04-13 16:08

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.

查看更多
登录 后发表回答