如何让Alexa在我的iOS应用程序上工作? [英] How can I get Alexa working on my iOS app?

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

问题描述

过去几天,我一直在检查Alexa技能套件.我也一直在仔细阅读技能"工具包和语音服务"的文档.我只是有点打trying,试图了解流程.我已经在开发人员控制台中实现了亚马逊的一种示例技能(最喜欢的颜色示例),并且还编写了一个示例lambda函数来处理将要传递的响应类型.它在测试模拟器上工作,剩下的基本上是通过我的ios应用程序运行lambda.但是,我的印象是我不必使用语音服务.我错了吗?我很困惑,如果任何一个更清楚的人都能对此事有所了解,那将是非常棒的.如果我也可以使用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?

推荐答案

基于

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捕获音频并将2条https消息发送到Alexa (一条消息带有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天全站免登陆