How to install Speech to text in Google Glass?

我只是一个虾纸丫 提交于 2019-12-01 07:28:29

问题


I developed an app using the Android 4.1.2 and speech to text is working well but when I tried it on the Google Glass it is not working(Activity not found exception). This is my Speech to text Code

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);
}

I tried to install the Speech Synthesis apk manually but when I tried to start the speech synthesis app crashed. Is there a way to install the speech synthasizer or is there a workaround code for the speech to text to work in the Google Glass?


回答1:


To use the standard android speech recognition you have to install/deploy the com.google.android.voicesearch apk package (the version of Voicesearch.apk must be the one that came with the Android 4.0 or later, it did not work with the older version of the Voicesearch.apks)

Just install it by using adb install < apk-file >

Then you should be able to use the voice recognition feature of android on your glass device.

Updated : After Google Glass is Updated to XE9 you dont have to install the Voice Apk. The default one works fine. To uninstall the Voice Search Use the following command

adb uninstall com.google.android.voicesearch


来源:https://stackoverflow.com/questions/18073695/how-to-install-speech-to-text-in-google-glass

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!