How to make alexa sample app (voice service) to call/invoke custom skills? - alexa-skills-kit

I have created a Amazon custom skill and using this skill in the test tab, I 'm able to get the intended response in the python code and turn the led on and off.
But I'm not able to make the Sample app (avs-device-sdk alexa voice application) to invoice/call the custom skill. Can you please guide what must be done to make this happen?
This is my first attempt in building custom skill/alexa voice service and trying my hands out. I 'm unclear what is the next step to make the alexa voice service to talk to the custom skill.

Related

Can i block the inbuild features in Alexa

I want to know that can Alexa train to listen only Custom created Skill ?
If yes can anyone tell me the procedure to do it.
I am into an project which basically includes Alexa into it, i want to block all the in build commands like "Alexa, Play a song", "Alexa, Play Sounds" and etc, i only want that Alexa should only listen to my custom skill rest all commands should be ignored. In the same way any other user should not add any Skill in Alexa.
Sir Please do help me in it,
It would be grateful
Alexa should ignore all that stuff when it uses your invocation name. For example if your invocation is cool music, when the user says alexa ask cool music to play a song it would ignore in built commands and follow the commands programmed by you.

Speech recognition in WordPress based on Alexa Skill

I would like to develop a WordPress plugin that will allow users to voice-interact with a WordPress website. I want it to be based on Alexa Skill.
What would be the architecture for this task?
If you think your use case is relatively standard, you can take a look at VoiceWP, which was built to allow for management of an Alexa skill mostly from within WordPress.
If you need something more custom, you can use the WordPress REST API to provide Alexa with the data you need. With this architecture, your plugin on the WordPress side would just be setting up and managing all the REST API endpoints.
From the top down the architecture looks like this:
This leaves you with 3 pieces to build:
Set up the Alexa Skill
First, you have to set up the skill with the Alexa Skills Kit. This involves setting up things like the name of your skill, the icon, and most importantly, where the skill should look to get it's functionality. In our example, we'll point the skill to an AWS Lambda function.
Set up the Lambda Skill to fulfill the Alexa input
Once the Skill knows to look to the Lambda function for it's functionality, we actually need to code the Lambda function. This can be done in Node.js (JavaScript), Python, Java (Java 8 compatible), C# (.NET Core) or Go. What the Lambda function needs to do is parse the JSON that comes from Alexa and determine which endpoint to call or which parameters to pass to this endpoint. For an example of this in Python, you can check out my example on GitHub.
Set up WordPress endpoints to provide data
Once you have the Lambda function parsing the user's intent and pushing the request to the specific endpoints, you need to write the code from within WordPress to make sure all the endpoints you need are available. This is the part that I'm able to give the least input on because the specific endpoints that you will need are based on your use case, which I don't really know at this point. But for an example of how we created a settings field and returned that value through a custom REST API endpoint, you can see this example on GitHub.
Wrapping up and Extending it Further
So once the data is returned from WordPress, formatted by the Lambda function and returned to Alexa, the user will hear the results of their query.
This can be customized and further functionality added by adding more endpoints to WordPress and more routing to the Lambda function based on new Alexa voice inputs.
Further Reading Watching
If you're interested in learning more, I've given a couple talks about this:
WP REST API as the Foundation of the Open Web Voice stuff starts at 11:06
Voice Is The New Keyboard: Voice Interfaces In 2018 And Beyond - This uses Google Home for the custom skill, but the ideas presented here are the same.

In alexa custom app Can I get the query as a voice stream/audio file of a user?

After the user invokes an app on Alexa , Is there a way to get the query as a voice stream/audio file of a user? Through alexa I want to send the stream to a webservice/lambda that the invoked app will call and analyze the intent there.
We have some proprietary code that we want to use for analyzing intent hence we cant do it on the alexa side
Since I am sending the query after the user has invoked the app and through the app there are no privacy concerns(hopefully)
Thanks
No, that is not possible, and I don't think it will be.
Echo devices connect to Amazon only, and Amazon uses Lex (which is also available via AWS) to parse speech files. As a skill developer, you will only receive the parsed results: intent, slots - and maybe, when Amazon implements user differentiation, an anonymous ID for the speaker.
There is no way to access the original speech audio in your skill. As every file is also used by Amazon to train their speech recognition, I doubt they will open their ecosystem accordingly.
Only option I see currently: build your own Echo with e.g. a Raspberry Pi, then you have full control. But you can't leverage the install base of Echo.
Same applies to Google Home and Microsoft Cortana, so it's not just Amazon.

Alexa skill kit vs Alexa Voice Service

I'm working on an Alexa skill (for Echo), and i've looked into Alexa skill kit from the very start.
Now, i'm confused about Alexa Voice Service. i've read documentation on Amazon, but cannot understand it in a better way.
Please guide about What's AVS? And how is it related to Alexa skills?
The Alexa Skill Kit is for creating skills that specifically run on the Amazon Echo or any other device that contains Alexa.
The Alexa Voice Service allows you to add Alexa's voice control to any product that has a microphone and speaker.
To Read more about Alexa Voice Service check out this link: https://developer.amazon.com/alexa-voice-service#How%20AVS%20Works
Alexa Skills Kit is for "making Alexa smarter" through developing custom skills.
Here's the SDK in Node.js that Amazon released on GitHub.
The prerequisite for these skills is that the user is already using an Alexa-enabled device, like the Echo or Echo Dot.
Alexa Voice Service SDK allows for device users to enable Alexa on any device with a microphone and speaker.
Here's the SDK in C++ that Amazon released on GitHub.
This means Alexa can end up in anything from a car to a smart fridge, if this SDK is used, which is super exciting!
Alexa Skill Kit (ASK) is for building skills that users will access via the Echo or other Alexa enabled devices (or apps).
The Alexa Voice Service (AVS) is for building those 'other Alexa enabled devices (or apps)'.
AVS (Alexa Voice Service) is for existing or new physical devices. If you add the AVS libraries, you can essentially turn that physical device into an Alexa-enabled device.
ASK (Alexa Skill Kit) on the other hand, is what helps you build "skills" for Alexa. BTW, you can still add skills for any device that you connect via AVS.
Alexa Voice Service
There are many ways to interact with Alexa -- with the Tap, Echo, Echo Dot, Echo Look, Echo Show, Dash Wand and the Amazon Fire TV. However, Amazon extended Alexa to third-party device makers through the Alexa Voice Service (AVS).
The AVS Device SDK provides C++-based libraries that enable any commercial device to process audio inputs and triggers, establish persistent connections with AVS, and handle all Alexa interactions.
Alexa Skills
The Skill Kit allows you to customize your Alexa conversation by building your custom skill. Skills are like third-party applications for Alexa speakers. There are more than 20,000 custom skills. For example you may say: "Alexa, open Jeopardy". You need to enable it to be able to use it.
I think of AVS as an API to integrate Alexa into any 3rd party hardware that has the capabilities of alexa (mic and speaker)
How AVS relates to ASK:
-AVS just has the same abilities of ASK, but isn't really used for anything specially amazon. I think AVS is more so again for 3rd party hardware so in building alexa skills there is no need to focus on it.

developing and testing alexa skill (with authorization)

I am about to develop my first custom skill for Alexa. I do not have a Echo device.
What I did was to creating and testing a basic skill with the amazon developer console (Alexa Skill + Lambda).
Now I'm have some general (nooby) questions here:
1) Is this really the way you have to develop and test your custom skills? I mean it is not the real user experience that can be tested. You have to enter the text and analyse the JSON request/responses. So, there is no realistic end-to-end testing possible?
2) What happens when you finish the developing phase in the Amazon developer console? I'm currently in the Testing step but I can see that the next steps are about publishing information (images, texts, etc.) and I can also see the button "Submit for Certification". So for me it seems that my custom skill gets published on some kind of market to other Alexa users? Is this correct? Is there a way to just use this skill for my personal usage - just like a APK-file Android app?
3) I'm developing a custom skill that needs some kind of authorization (User). I see there is a large article about it and it seems that there is some action on the Alexa App needed on the smartphone. My question is now here, how to test it without having a real device? Is it actually possible?
I'd suggest, first test locally, then use the test console and
finally, you can use https://echosim.io which will provide you a
very close test bed to what you get when interacting with the Echo
(more precisely, the Echo Tap, you have to tap the button for it to
listen).
If you just want the skill for yourself, forget about
anything past the testing step. That extra information is only for
the "store" as you guessed.
If you only need to identify individual
users, then you DO NOT need to use the user authentication stuff.
There is a unique user identifier provided in every request. If you
want to authenticate users with a third party Oauth-like scheme,
then read that document.
There's a pretty useful series by Big Nerd Ranch about developing the skills locally using NodeJS: https://www.bignerdranch.com/blog/developing-alexa-skills-locally-with-nodejs-setting-up-your-local-environment/. They use alexa-app, mocha, chai, and alexa-app-server.

Resources