语音命令在谷歌玻璃应用程序?

编程入门 行业动态 更新时间:2024-10-19 08:54:03
本文介绍了语音命令在谷歌玻璃应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经发展到对谷歌的玻璃上运行Android应用程序。我运行使用亚行吧。是否有可能给配置语音命令,这样我可以触发它说好吧玻璃+我的命令??

I have an android app developed to run on the google glass. And I run it using the adb. is it possible to give configure a voice command so that I can trigger it by saying "Ok GLASS" + "My Command" ??

推荐答案

更​​新 - XE16更新下面的方法行不通后,新的解决方案是在这里Why从XE16确定玻璃菜单我的声音命令失踪?

Update - After XE16 update the following method does not work, the new solution is here Why is my voice command missing from the ok glass menu in XE16?

什么,你需要做的是,

  • 在清单文件中添加这些标签下,你想你的语音命令上触发的服务。

  • Inside the manifest file add these tags under the service which you wanted to trigger on your voice command. <intent-filter> <action android:name="com.google.android.glass.action.VOICE_TRIGGER" /> </intent-filter> <meta-data android:name="com.google.android.glass.VoiceTrigger" android:resource="@xml/voice_trigger_start" />

  • 而你必须创建内部资源称为XML的文件夹,并添加名为 voice_trigger_start.xml XML文件。

  • And you have to create a folder called xml inside res and add a xml file named as voice_trigger_start.xml.

    这里面添加这些行

    <?xml version="1.0" encoding="utf-8"?> <trigger keyword="@string/its_me_amalan" />

  • 打开值文件夹中的 RES 文件夹,并修改的strings.xml ,所以它看起来像这样

  • Open the values folder inside the res folder and edit strings.xml, so it will look like this

    <resources> <string name="app_name">Amalan</string> <string name="its_me_amalan">Hello Amalan</string> <string name="stop">Stop</string> </resources>

  • 现在安装应用程序在玻璃上,并说的 OK玻璃,您好Amalan 的和应用程序打开。

    Now install the app onto Glass and say "ok glass, Hello Amalan" and the app opens.

    参考:的pathofa$c$cr/2013/11/20/google-glass-adding-your-own-voice-commands-to-your-apps/

    更多推荐

    语音命令在谷歌玻璃应用程序?

    本文发布于:2023-11-11 05:57:00,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1577571.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:应用程序   语音   命令   玻璃

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!