如何让 Alexa 在我的 iOS 应用上运行? [英] How can I get Alexa working on my iOS app?

查看:27
本文介绍了如何让 Alexa 在我的 iOS 应用上运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几天我一直在查看 Alexa 技能套件.我还一直在仔细阅读技能套件和语音服务的文档.我只是在尝试理解流程时遇到了一点小问题.我已经在开发者控制台中实现了亚马逊的一个示例技巧(最喜欢的颜色示例),并且还编写了一个示例 lambda 函数来处理将要传递的响应类型.它在测试模拟器上工作,剩下的基本上是让 lambda 通过我的 ios 应用程序运行.但是我的印象是我不必使用语音服务.我错了吗?我很困惑,如果有更清楚的人可以对此事有所了解,那就太棒了.如果我也让 lambda 工作,我认为它会接受特定格式的请求.我必须将编码的音频发送到哪里才能获得要发送到技能套件的 json 响应?到 Alexa 语音服务?

I have been checking out the Alexa Skills kit the past few days. I have also been poring through the documentations for both the Skills kit and the Voice Service. I am just having a little hiccup trying to understand the flow. I have implemented one of amazon's sample skills (favourite colour sample) in the developer console and also wrote a sample lambda function to handle the type of response that will be delivered. Its working on the test simulator and what left is basically getting lambda running through my ios app. However I have the impression that I don't have to use the voice service. Am I wrong? I am quite confused, it would be awesome if anybody who has some more clarity could shed some light on the matter. If I get lambda working also, I think it will accept requests that are in a particular format. Where do I have to send the encoded audio to get a json response to send to the skills kit? To the Alexa Voice Service?

此外,我正在使用 cognito 和 dynamo db 对我的应用程序进行身份验证.如果我要使用 Alexa 语音服务,则提到用户还必须登录亚马逊.那么我还需要使用 amazon sdk 登录吗?或者有解决方法吗?

Also I am authenticating my app using cognito and dynamo db. If I were to use Alexa Voice Service, then it is mentioned that the user will have to also login to amazon. So do I still have to work with the login with amazon sdk? Or is there a workaround?

推荐答案

基于 亚马逊文档 有两种与 Alexa 交互的方式:

Based on Amazon documentation there are two ways to interact with Alexa:

听起来您想通过 Companion 方法实现该应用.

Sounds like you want to implement the app thru the Companion method.

就 JSON 而言,我目前正在解决该问题,(一旦解决,将发布答案).

As far as the JSON goes, i am currently resolving that issue now, (will post answer once I have it resolved).

基本上,您必须使用 AVFoundation 从 iPhone 捕获音频并向 Alexa 发送 2 条 https 消息(一条消息带有 JSON 正文,第二条消息将音频捕获为正文.) 基于文档

Basically you have to use AVFoundation to capture audio from iPhone and send 2 https messages to Alexa (One message with JSON Body & the second message with audio captured as body.) Bases on Documentation

  1. 配套应用(您有一台设备(例如智能扬声器)想要将 Alexa 添加到其中.因此,您构建了对 AVS 的支持.太好了!现在您需要一种对其进行授权并将其与用户帐户关联的方法.这就是配套应用"方法.配套应用连接到您的智能产品,并允许用户登录并授权演讲者使用 Alexa 并连接到他们的亚马逊帐户.)

  1. Companion App (You have a device (such as a smart speaker) that you want to add Alexa to. So, you build in support for AVS. Great! Now you need a way to authorize it and associate it with the user's account. This is the "companion app" approach. The companion app connects to your smart product and allows the user to login and authorize the speaker to use Alexa and connect to their Amazon account.)

移动网站

AVS 应用(您没有需要授权的设备 - 相反,您想从您的 Android/Iphone 应用程序中与 Alexa 通话.)

AVS App (You don't have a device you need to authorize - instead you want to speak to Alexa from within your Android/Iphone application.)

Android 或 Iphone

这篇关于如何让 Alexa 在我的 iOS 应用上运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆