gpt4 book ai didi

android - 如何使用Android编程打开S Voice

转载 作者:太空狗 更新时间:2023-10-29 13:56:43 26 4
gpt4 key购买 nike

我在 Galaxy S4 中使用 Android 5.0。当我双击主页按钮时,S 语音打开。我想让代码打开它。我使用了下面的代码,但代码只打开谷歌语音。如何在没有任何配置的情况下打开 S Voice?非常感谢

        Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, "en-US");
try {
startActivityForResult(intent, 1);
} catch (ActivityNotFoundException a) {
Toast.makeText(this, "Oops! Your device doesn't support Speech to Text",Toast.LENGTH_SHORT).show();
}

这是 S-Voice

enter image description here

更新:我安装了软件Dexplorer,找到了Svoice。但是,我无法访问查看 AndroidManifest.xml

enter image description here

最佳答案

我安装的 S-Voice 版本将响应以下任何 Intent 操作:

            final String SVOICE_PACKAGE_NAME = "com.vlingo.midas";
final String SVOICE_LISTEN_ACTION = "com.sec.action.SVOICE";

final Intent intent = new Intent();
intent.setPackage(SVOICE_PACKAGE_NAME);

intent.setAction(SVOICE_LISTEN_ACTION);

// intent.setAction(Intent.ACTION_VOICE_COMMAND);

// intent.setAction(RecognizerIntent.ACTION_VOICE_SEARCH_HANDS_FREE);
// intent.putExtra(RecognizerIntent.EXTRA_SECURE, false);

intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);

try {
startActivity(intent);
} catch (final ActivityNotFoundException e) {
e.printStackTrace();
} catch (final Exception e) {
e.printStackTrace();
}

关于android - 如何使用Android编程打开S Voice,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38943002/

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