0

语音识别:

我使用此代码来检测:

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一个变量。我选择土耳其语它适用于土耳其语,但同时适用于英语

我不明白如果谷歌理解每种语言,为什么我们使用EXTRA_LANGUAGE参数。

我想用谷歌强制检测土耳其语

可能吗

4

1 回答 1

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);
于 2016-12-17T12:13:24.223 回答