android - 如何在 Google Glass 中安装语音转文本功能?

标签 android speech google-glass speech-synthesis

我使用 Android 4.1.2 开发了一个应用程序,语音转文本功能运行良好,但当我在 Google Glass 上尝试时,它不起作用(未找到 Activity 异常)。 这是我的语音转文本代码

Intent intent = new Intent(
                RecognizerIntent.ACTION_RECOGNIZE_SPEECH);

        intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, "en-US");

        try {
            startActivityForResult(intent, requestCode);
        } catch (ActivityNotFoundException a) {
            Toast t = Toast.makeText(getApplicationContext(),
                    "Opps! Your device doesn't support Speech to Text",
                    Toast.LENGTH_SHORT);
}

我尝试手动安装语音合成 apk,但当我尝试启动语音合成应用程序时崩溃了。有没有办法安装语音合成器,或者是否有解决方法代码可以让语音转文本在 Google Glass 中工作?

最佳答案

要使用标准 Android 语音识别,您必须安装/部署 com.google.android.voicesearch apk 包 (Voicesearch.apk的版本必须是Android 4.0或更高版本自带的版本,旧版本的Voicesearch.apk不支持)

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

然后您应该能够在玻璃设备上使用 Android 的语音识别功能。

更新:Google Glass 更新至 XE9 后,您无需安装 Voice Apk。默认的就可以正常工作。 卸载语音搜索 使用以下命令

adb uninstall com.google.android.voicesearch

关于android - 如何在 Google Glass 中安装语音转文本功能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18073695/

相关文章:

java - 使用 .apk 预加载 Google Glass

android - 谷歌眼镜 - 查看捕获手势(向下滑动)

Android SQLite 数据库 : Creating db at runtime or using prepopulated db?

android - 结合 CoverFlow 和通用图像加载器

c# - 在代码中处理语音命令以执行命令的智能方式

speech-recognition - 从谷歌语音 api 结果中检测流畅度

java - Android 比较 boolean 值

android - 以编程方式更新 apk(无需 root)

codec - 如何在我的 Java 应用程序中使用 Opus-Codec

google-app-engine - 找不到导入 : "code.google.com/p/goauth2/oauth"