200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > amazon alexa_亚马逊使向自定义Alexa Skills添加声音变得更加容易

amazon alexa_亚马逊使向自定义Alexa Skills添加声音变得更加容易

时间:2020-02-15 11:02:59

相关推荐

amazon alexa_亚马逊使向自定义Alexa Skills添加声音变得更加容易

amazon alexa

by Terren Peterson

由Terren Peterson

亚马逊使向自定义Alexa Skills添加声音变得更加容易 (Amazon has made it easier to add sounds to custom Alexa Skills)

I’m recognized as an Amazon Alexa Champion and have published more than twenty custom skills on the platform. I continue to look for new ways to stretch this technology, and one of the best ways I’ve found to improve the user experience is by adding sounds. Given the recent improvement to the Amazon Alexa platform, this has just gotten even easier. Here is a brief review on how you can take advantage of this new feature.

我被公认为Amazon Alexa冠军,并且已经在平台上发布了二十多种自定义技能。 我一直在寻找扩展该技术的新方法,而我发现改善用户体验的最佳方法之一就是添加声音。 考虑到Amazon Alexa平台最近的改进 ,这变得更加容易。 这是有关如何利用此新功能的简要概述。

亚马逊Alexa的工作方式 (How Amazon Alexa works)

The Alexa platform has the ability to enable custom skills made by third-party developers. There are now more than 30k of them available, and the millions of Alexa users can enable them on their devices. These range from ordering a pizza from a popular chain to playing sounds to aid sleeping.

Alexa平台具有启用第三方开发人员定制技能的能力。 现在有超过3万个可用,而数百万的Alexa用户可以在其设备上启用它们。 从订购流行的披萨比萨到播放声音以帮助睡眠,范围很广。

The architecture for these custom skills has two components. The first is the voice component that leverages the machine learning models of the Alexa platform. This is what translates the spoken word requests into a set of instructions.

这些自定义技能的体系结构包含两个组件。 第一个是利用Alexa平台的机器学习模型的语音组件。 这就是将口语请求转换为一组指令的原因。

The other component is the if/then/else logic that decides what answer should come back to the user. This is hosted on an AWS Lambda function.

另一个组件是if / then / else逻辑,它决定应将什么答案返回给用户。 它托管在AWS Lambda函数上。

To enhance skills, additional AWS services can be used, as well as third-party tools. This includes recording custom MP3 sounds and graphics that can be leveraged by the Lambda function.

为了提高技能,可以使用其他AWS服务以及第三方工具。 这包括录制Lambda函数可以利用的自定义MP3声音和图形。

To add sounds, MP3 files are uploaded into an S3 bucket, and the appropriate access policy is applied so that it can be read by an Alexa device.

要添加声音,请将MP3文件上载到S3存储桶中,并应用适当的访问策略,以便Alexa设备可以读取它。

添加自定义声音的挑战 (Challenges with adding custom sounds)

One of the barriers to entry for including sounds into custom skills has been the ability to record high-quality sounds. These sounds need to match the exact standards for the platform, including bit rate and sample rates. This can be done through sound editing expertise using software like Audacity, but adds time to developing the skill.

要将声音包含到自定义技能中的入门障碍之一是录制高质量声音的能力。 这些声音需要与平台的确切标准匹配,包括比特率和采样率。 这可以通过使用Audacity之类的软件通过声音编辑专业知识来完成,但是会增加开发技能的时间。

Recording high-quality sounds can also be a challenge. There are apps for mobile devices that enable recording, but access to a wide variety of sounds is difficult. For example, recording the roar of an airplane, or the sound that an elephant makes.

录制高质量的声音也可能是一个挑战。 有一些用于移动设备的应用程序可以录音,但是要访问各种声音很困难。 例如,记录飞机的轰鸣声或大象发出的声音。

Alternatively, an Alexa developer can search for sounds that have been recorded by others. There are some repositories on the internet that have these, but most cost money to license and require resampling with software like Audacity to get the right sound attributes.

另外,Alexa开发人员可以搜索其他人录制的声音。 互联网上有一些存储库具有这些存储库,但是大多数存储库需要花费许可费用,并且需要使用Audacity之类的软件进行重采样才能获得正确的声音属性。

免费的MP3内容 (Free MP3 content)

Amazon has now published a catalog of hundreds of sounds already recorded under the exact standards required by the platform. Just like in the architecture diagram above, they are published into an S3 bucket on AWS and can be used by any custom skill.

亚马逊现在已经发布了数百种声音的目录,已经按照该平台要求的确切标准进行了录制。 就像上面的架构图中一样,它们被发布到AWS上的S3存储桶中,并且可由任何自定义技能使用。

The complete list is provided on the developer page, and here are the main categories.

开发人员页面上提供了完整列表,这是主要类别。

The range is expansive. Motorcycle engines, fireworks noises, and the roar of a bear are all at your fingertips. There are no royalties required for using these, and the cost for downloading the sound clips is not charged to your AWS account.

范围广阔。 摩托车引擎,烟花声和熊的吼声都触手可及。 使用它们不需要使用费,下载声音片段的费用也不计入您的AWS账户。

如何使用声音的基本技巧 (How to use sound in a basic skill)

If you’re just getting started with Amazon Alexa, start with the basic templates from the Alexa GitHub page. This includes building a trivia skill, fact skill, or simple guessing games. For example, I recently published a fun kids skill called Easter Egg Hunt. Here is the complete repo on GitHub, including both the Lambda function as well as the intent model.

如果您刚刚开始使用Amazon Alexa,请从Alexa GitHub页面上的基本模板开始。 这包括建立琐事技巧,事实技巧或简单的猜谜游戏。 例如,我最近发布了一项有趣的儿童技能,称为“复活节彩蛋狩猎”。 这是 GitHub上的完整存储库 ,包括Lambda函数和意图模型。

With any of the message responses, you can add the SSML syntax to include the link to the MP3 file in the S3 bucket. Here is an example from the Welcome Handler for the Easter Egg skill.

使用任何消息响应,您都可以添加SSML语法以在S3存储桶中包括指向MP3文件的链接。 这是来自迎宾处理程序的复活节彩蛋技能示例。

// This is the initial welcome messagevar welcomeMessage = "<audio src=’/ask-soundlibrary/musical/amzn_sfx_trumpet_bugle_03.mp3'/>Welcome to the Easter Bunny Egg Hiding Game. I will ask you multiple questions that you should answer yes or no. Based on your choices, I will make a recommendation on where to hide an egg. Are you ready to begin?";this.emit(':ask', welcomeMessage, repeatWelcomeMessage);

When the user first invokes this custom skill, the Alexa device plays the sound clip for the trumpet bugle, then reads the syntax with the standard voice.

当用户首次调用此自定义技能时,Alexa设备会播放小号军号的声音片段,然后使用标准语音读取语法。

准备开始了吗? (Ready to get started?)

Go ahead and sign-up for a free developer account on Amazon, and start building your first skill today! The Amazon developer blog has some great resources to leverage on this topic, including this recent post giving ideas on how to use this new content.

继续并在亚马逊上注册一个免费的开发人员帐户 ,今天就开始建立您的第一技能! 亚马逊开发人员博客提供了一些很好的资源来利用这一主题,包括最近的这篇文章 ,就如何使用此新内容提供了一些想法。

翻译自: /news/amazon-has-made-it-easier-to-add-sounds-to-custom-alexa-skills-513b865d7528/

amazon alexa

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。