简体   繁体   English

向Android应用添加语音命令

[英]Add voice commands to Android app

I want to integrate voice actions from 'ok Google' assistant to my app. 我想将“ ok Google”助手的语音操作集成到我的应用中。 Like WhatsApp did in the attached images. 就像WhatsApp在所附图片中所做的那样。

Any references in how to do it? 有什么参考资料怎么做?

在此处输入图片说明 在此处输入图片说明

Android Linking is currently in developer preview. Android Linking当前处于开发人员预览中。 You can build actions that use this feature, but they can't be published at this time. 您可以构建使用此功能的操作,但目前无法发布。

You can ask the user to continue an interaction via your Android app. 您可以要求用户通过您的Android应用继续进行互动。 This helper allows you to prompt the user as part of the conversation. 此帮助程序允许您在对话中提示用户。 You'll first need to associate your Android app with your Actions Console project via the Brand Verification page. 您首先需要通过“ 品牌验证”页面将Android应用程序与Actions Console项目相关联。

You will need to create a deep link to your Android app and then create a Dialogflow intent that specifies the corresponding event for the helper intent (actions_intent_LINK). 您将需要创建一个到您的Android应用程序的深层链接 ,然后创建一个Dialogflow意向,该意向为助手意向指定相应的事件(actions_intent_LINK)。

To have the assistant connect directly to your app, you'll need to setup implicit invocation. 要使助手直接连接到您的应用程序,您需要设置隐式调用。

Implicit invocation: When users invoke your Action without using its name (eg "Hey Google, I need a chicken soup recipe"). 隐式调用:当用户在不使用您的操作名称的情况下调用您的操作时(例如“嘿Google,我需要一份鸡汤配方”)。 The Assistant matches the user's request based on various signals, and presents the user with a selection of Actions they can choose to fulfill their intent. 助手基于各种信号来匹配用户的请求,并向用户显示他们可以选择实现自己意图的一系列操作。

To add your intent for deep linking and implicit invocation, do the following: 要添加深层链接和隐式调用的意图,请执行以下操作:

  1. In the Dialogflow Console left navigation, click on Integrations. 在Dialogflow控制台的左侧导航中,单击Integrations。
  2. In the Google Assistant card, click Integration Settings. 在Google助手卡中,点击集成设置。
  3. List item Under Discovery > Implicit Invocations, click on Add intent and type the name of your intent 列表项在“发现”>“隐式调用”下,单击“添加意图”,然后键入意图的名称

在此处输入图片说明

Full details are in step #3 of the Build Actions for the Google Assistant (Level 2) Codelab . 有关详细信息,请参见Google Assistant(第2级)Codelab构建操作的第3步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM