简体   繁体   English

您如何从 Alexa 设备获取原始语音输入

[英]How do you take raw voice input from an Alexa device

I have created an Alexa skill which I can successfully interact with using various intents.我创建了一个 Alexa 技能,我可以使用各种意图成功地与之交互。 However, these are fixed answers/inputs.但是,这些是固定的答案/输入。 I would like to receive raw input from the Alexa device into my Amazon AWS Lambda function.我想从 Alexa 设备接收原始输入到我的 Amazon AWS Lambda 函数中。 For example, if I had the Alexa device ask 'What is your username', and the person responded 'Allie123', how would I receive 'Allie123' as a string in my Lambda function.例如,如果我让 Alexa 设备询问“您的用户名是什么”,而对方回答“Allie123”,我将如何在我的 Lambda 函数中接收“Allie123”作为字符串。 Thanks.谢谢。

Use AMAZON.SearchQuery to capture arbitrary input from the user.使用 AMAZON.SearchQuery 捕获用户的任意输入。 There are limitations but this is the correct tool for the job.有一些限制,但这是完成这项工作的正确工具。 There are a few ways to use it:有几种使用方法:

  1. regular intent with carrier phrase, one SearchQuery slot and no other slots.带有载体短语的常规意图,一个 SearchQuery 槽,没有其他槽。 This works fine but requires the user to say the carrier phrase.这工作正常,但需要用户说出载体短语。

  2. as for #1 but with an 'whitespace only' carrier phrase.至于#1,但带有“仅限空白”的载体短语。 This will trigger on anything that doesn't match your other intents.这将触发与您的其他意图不匹配的任何内容。 The precedence rules in Alexa fortunately ensure that it will not match if a 'normal' intent can match.幸运的是,Alexa 中的优先规则确保如果“正常”意图可以匹配,它就不会匹配。 This can be interesting approach for prototypes/development skills but most likely will not pass certification due to privacy concerns.这对于原型/开发技能来说可能是一种有趣的方法,但由于隐私问题,很可能不会通过认证。

  3. slot-elicitation on a SearchQuery slot. SearchQuery 槽上的槽引出。 This can only be used when you have issued a prompt such as "what is your full name?"这只能在您发出“您的全名是什么?”等提示时使用。 but it will always match the next utterance and doesn't require carrier phrase.但它将始终匹配下一个话语,并且不需要载体短语。 If you can ask the user a question before they provide input then this is your best bet.如果您可以在用户提供输入之前向他们提出问题,那么这是您最好的选择。

More info: https://developer.amazon.com/blogs/alexa/post/a2716002-0f50-4587-b038-31ce631c0c07/enhance-speech-recognition-of-your-alexa-skills-with-phrase-slots-and-amazon-searchquery更多信息: https : //developer.amazon.com/blogs/alexa/post/a2716002-0f50-4587-b038-31ce631c0c07/enhance-speech-recognition-of-your-alexa-skills-with-phrase-slots-and -amazon-searchquery

Some discussion of the various other options can be found at: https://developer.amazon.com/blogs/alexa/post/a3142024-75cf-46bb-924a-0ab3524a5c07/5-techniques-to-replace-amazon-literal-and-improve-skill-accuracy可以在以下位置找到对各种其他选项的一些讨论: https : //developer.amazon.com/blogs/alexa/post/a3142024-75cf-46bb-924a-0ab3524a5c07/5-techniques-to-replace-amazon-literal-并提高技能准确性

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

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