简体   繁体   English

如何在Google Assistant应用中关闭麦克风

[英]How to close mic in google assistant app

I had submitted my app for review, but Google replied with "mic" issue. 我已经提交了我的应用程序以供审核,但Google回答了“ mic”问题。 Google Replied : Google回复:

During our testing, we found that your app would sometimes leave the mic open for the user without any prompt. 在测试过程中,我们发现您的应用有时会在没有任何提示的情况下为用户打开麦克风。 Make sure that your app always says something before leaving the mic open for the user, so that the user knows what they can say. 在让用户打开麦克风之前,请确保您的应用始终会说些什么,以便用户知道他们可以说些什么。 This is particularly important when your app is first triggered. 当您的应用程序首次被触发时,这一点尤其重要。

Some Points: 1. app.ask()---leaves the mic opens. 一些要点:1. app.ask()---打开麦克风。 2. app.tell()---app leaves the conversation. 2. app.tell()--- app离开对话。

I have also enabled the "toggle" of "Set this intent as end of conversation". 我还启用了“将此意图设置为对话结束”的“切换”。

Any suggestions?? 有什么建议么??

My app is one to one ie If user ask "my address" then address is shown, If "show me direction to PLACE_NAME" then directions are shown. 我的应用是一对一的,即如果用户问“我的地址”,则显示地址;如果“向我显示前往PLACE_NAME的路线”,则显示方向。 BUT after it mic opens. 但麦克风打开后。 How to close it? 如何关闭?

-----UPDATED------- - - -更新 - - - -

fuction someName(app)
{
//---code-----

   app.ask('Alright, your address is '+ user_address);
}

I don't want to use app.tell() as it closes the app. 我不想在关闭应用程序时使用app.tell()。 Some other suggestion for this one to one Q/A conversation. 有关此一对一Q / A对话的其他建议。

If you are doing fulfillment through a webhook, then the "end conversation" toggle is ignored in favor of what you are sending from your webhook. 如果您正在通过网络挂钩进行充实,那么“结束对话”切换将被忽略,而有利于您从网络挂钩发送的内容。

You don't show any code, but as noted: 您没有显示任何代码,但是请注意:

  • If you use app.ask() or one of the variants of it, the message will be sent to the user and the microphone will be left open. 如果您使用app.ask()或其变体之一,则消息将发送给用户,并且麦克风将保持打开状态。 In this case, you should make sure it is clear what you're expecting from the user - in other words, ask a question or prompt them. 在这种情况下,您应该确保清楚用户的期望-换句话说,提出问题或提示他们。

  • If you use app.tell() , the message will be sent to the user and the microphone will be closed. 如果您使用app.tell() ,则消息将发送给用户,并且麦克风将关闭。 This will end this conversation. 这将结束此对话。

It sounds like, in your case, you should be using app.tell() . 听起来,您应该使用app.tell()

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

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