android - 从 Google Glass 使用 Android 语音识别 API

标签 android google-glass android-speech-api

作为概念验证,我正在努力调整现有的 Android 应用程序以在 Google Glass 上运行。我想在我的应用程序中使用语音输入来替换目前需要触摸输入的一些功能。

我可以将我的 APK 部署到 Google Glass 并毫无问题地运行它(通过 ADB),但是一旦它运行,我尝试过的 Android 语音识别 API 都无法在 Glass 上运行:

startActivityForResult(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH));

当在 Google Glass 上运行时,这会导致 ActivityNotFoundException(“找不到处理 Intent 的 Activity ”)

SpeechRecognizer.IsRecognitionAvailable(context);

这在 Google Glass 上总是返回 false。

我很好奇是否还有其他人遇到过这些问题或有任何建议。

最佳答案

要使用标准的 android 语音识别,您必须安装/部署 com.google.android.voicesearch apk 包。

我不知道是否有官方的方式来获取这个。我刚刚用谷歌搜索了 apk 文件。

只需使用 adb install < apk-file > 即可安装它

那么你应该可以在你的玻璃设备上使用安卓的语音识别功能了。


另一种方法是使用 google glass 非常酷的功能,例如只需说“okay glass”即可激活语音识别。

但是因此您必须对您的设备进行 root 操作并激活这个所谓的实验室功能。

这一面是激活实验室功能的良好起点:glassxe

我还没有亲自尝试过,但我会去尝试。

关于android - 从 Google Glass 使用 Android 语音识别 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17414251/

相关文章:

java - 从 Android 中使用 Google Mirror API 附加图像不起作用

android - 如何防止Android SpeechRecognizer被破坏后发出声音?

android - 在创建位图时抛出 OutOfMemoryError

Android SQLite 到我的 MySQL Web 服务器?

java - 警告 :com. firebase.ui.auth.util.ui.FlowUtils

java - Eclipse - 导入了一个项目,Eclipse 给我错误的@override 方法注释错误

java - 谷歌眼镜 : Developing and testing using PlayGround

android - 在桌面上从 Google Glass 进行屏幕录像的可能替代方案是什么?

java - TextToSpeech 无法正确停止

android - 模拟器中 Google Wear 上的语音识别器没有语音输入