简体   繁体   English

如何使用RecognizerIntent强制使用土耳其语?

[英]How can I use RecognizerIntent to force using Turkish?

to voice recognation: 进行语音识别:

I use this code to detect: 我使用此代码来检测:

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 );

the lcl is a variable. lcl是一个变量。 I choice turkish it works on turkish but at the same time works with english 我选择土耳其语 ,但它适用于土耳其语,但同时适用于英语

I do not understand If google understand every language why we use EXTRA_LANGUAGE parameter. 我不明白,如果Google理解每种语言,为什么我们使用EXTRA_LANGUAGE参数。

I want to google force to detect turkish 我想用Google强制检测土耳其语

is it possible 可能吗

try this: 尝试这个:

        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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM