语音识别:
我使用此代码来检测:
Intent myintent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
myintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
myintent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, lcl );
lcl
是一个变量。我选择 turkish 它适用于土耳其语,但同时适用于英语
我不明白如果谷歌了解每种语言我们使用 EXTRA_LANGUAGE 参数的原因。
我想谷歌强制检测土耳其
是否可能
答案 0 :(得分:1)
试试这个:
recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "tr-TR");
recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, getPackageName());
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);