1
在我的应用程序中,我尝试创建一个语音识别器,从文本到语音谷歌API,用于土耳其语,并通过EXTRA_LANGUAGE_PREFERENCE
作为“tr_TR”识别并返回土耳其语的结果,但其识别内容英语但不是土耳其语。如何为SpeechRecognizer设置土耳其语语音Google SpeechToText APi
String lang_code="tr_TR";
recognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE,
lang_code);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, lang_code);
recognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
this.getPackageName());
recognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_WEB_SEARCH);
recognizerIntent.putExtra(RecognizerInt
ent.EXTRA_MAX_RESULTS, 3);
你从哪儿弄来的'tur'?它是'tr_TR',从Android 2.3开始支持。看到这个[post](http://stackoverflow.com/questions/7973023/what-is-the-list-of-supported-languages-locales-on-android)供您参考。 –
您是否尝试过“tr-TR”? –
好的,但是你在哪里将语言环境更改为土耳其语? –