gpt4 book ai didi

android - 如何在 Google Glass 中安装 Speech to text?

转载 作者:行者123 更新时间:2023-11-29 00:27:51 25 4
gpt4 key购买 nike

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

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.apks 一起使用)

只需使用 adb install 安装即可

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

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

adb uninstall com.google.android.voicesearch

关于android - 如何在 Google Glass 中安装 Speech to text?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18073695/

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