Android:语音识别显式停止?

标签 android voice-recognition

我知道您可以通过调用来增加认为输入完成的时间:

intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS,5000);

但是,在启动 Android 语音识别 Activity 后,是否有办法显式停止它,比如在收到“关键字”后说。

最佳答案

@Mike 是对的。

这个有效:

Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS, new Long(2000)); 

您指定了长整型。仅输入数字(“2000”)会被解释为整数,这是无效的。

关于Android:语音识别显式停止?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5640455/

相关文章:

c# - Windows 手机 | VoiceCommand 能否导致方法调用而不是导航

java - Firebase Firestore 架构 : Reference or Object?

android - cordova 检测应用程序是否从 Google Play 下载

android - 在 Android 2.3 上按下菜单按钮时应用程序崩溃

android - Glass 语音命令与给定列表中最接近的匹配项

Android - 语音识别一个词?

android - 当布局具有属性 android : layout_height = "wrap_content"? 时,如何在布局底部设置元素

java - 在外部库中启用日志记录

android - 如何识别用户何时开始和停止在 android 中说话? (Android中的语音识别)

android - Android 模拟器上的音频输入