gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 09:06:54 25 4
gpt4 key购买 nike

语音识别:

我使用此代码来检测:

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

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

I want to google force to detect turkish

可以吗

最佳答案

试试这个:

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

关于java - 如何使用 RecognizerIntent 强制使用土耳其语?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41198251/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com