Alexa Skill: Playing Audio results in “Sorry don't know that”
I am coding my very first alexa skill and am very excited! I am trying to make a skill so that when I say "ramranch", alexa will play Sunil Syal. I started this skill using the space fact picker blueprint. I have deleted that code and put in my own. The aws is connected and is working, however when I say "ramranch" in the testing console, Alexa responds with "Sorry, I don't know that". Their is no debug or error message.
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const RamRanch = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest'
|| (request.type === 'IntentRequest'
&& request.intent.name === 'handle');
},
handle(handlerInput) {
this.emit(':tell', "Let's enjoy a world's most beautiful composition, composed by the great, Sunil Syal, <audio src='https://my-apis.000webhostapp.com/audio/Romantic%20Solitude-Instrumental%20(Flute).mp3'/> Wow, That is amazing. Click the link on top right corner to listen to full song.");
}
}
const HelpHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest'
&& request.intent.name === 'AMAZON.HelpIntent';
},
handle(handlerInput) {
return handlerInput.responseBuilder
.speak(HELP_MESSAGE)
.reprompt(HELP_REPROMPT)
.getResponse();
},
};
const ExitHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest'
&& (request.intent.name === 'AMAZON.CancelIntent'
|| request.intent.name === 'AMAZON.StopIntent');
json amazon-web-services alexa
New contributor
add a comment |
I am coding my very first alexa skill and am very excited! I am trying to make a skill so that when I say "ramranch", alexa will play Sunil Syal. I started this skill using the space fact picker blueprint. I have deleted that code and put in my own. The aws is connected and is working, however when I say "ramranch" in the testing console, Alexa responds with "Sorry, I don't know that". Their is no debug or error message.
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const RamRanch = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest'
|| (request.type === 'IntentRequest'
&& request.intent.name === 'handle');
},
handle(handlerInput) {
this.emit(':tell', "Let's enjoy a world's most beautiful composition, composed by the great, Sunil Syal, <audio src='https://my-apis.000webhostapp.com/audio/Romantic%20Solitude-Instrumental%20(Flute).mp3'/> Wow, That is amazing. Click the link on top right corner to listen to full song.");
}
}
const HelpHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest'
&& request.intent.name === 'AMAZON.HelpIntent';
},
handle(handlerInput) {
return handlerInput.responseBuilder
.speak(HELP_MESSAGE)
.reprompt(HELP_REPROMPT)
.getResponse();
},
};
const ExitHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest'
&& (request.intent.name === 'AMAZON.CancelIntent'
|| request.intent.name === 'AMAZON.StopIntent');
json amazon-web-services alexa
New contributor
maybe it doesn't think you're saying ramranch
– johnny 5
Dec 27 '18 at 17:31
ah well you see you actually type in the words into the console whenyour building/testing the skill.
– Nuckers Buckers
Dec 27 '18 at 17:37
add a comment |
I am coding my very first alexa skill and am very excited! I am trying to make a skill so that when I say "ramranch", alexa will play Sunil Syal. I started this skill using the space fact picker blueprint. I have deleted that code and put in my own. The aws is connected and is working, however when I say "ramranch" in the testing console, Alexa responds with "Sorry, I don't know that". Their is no debug or error message.
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const RamRanch = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest'
|| (request.type === 'IntentRequest'
&& request.intent.name === 'handle');
},
handle(handlerInput) {
this.emit(':tell', "Let's enjoy a world's most beautiful composition, composed by the great, Sunil Syal, <audio src='https://my-apis.000webhostapp.com/audio/Romantic%20Solitude-Instrumental%20(Flute).mp3'/> Wow, That is amazing. Click the link on top right corner to listen to full song.");
}
}
const HelpHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest'
&& request.intent.name === 'AMAZON.HelpIntent';
},
handle(handlerInput) {
return handlerInput.responseBuilder
.speak(HELP_MESSAGE)
.reprompt(HELP_REPROMPT)
.getResponse();
},
};
const ExitHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest'
&& (request.intent.name === 'AMAZON.CancelIntent'
|| request.intent.name === 'AMAZON.StopIntent');
json amazon-web-services alexa
New contributor
I am coding my very first alexa skill and am very excited! I am trying to make a skill so that when I say "ramranch", alexa will play Sunil Syal. I started this skill using the space fact picker blueprint. I have deleted that code and put in my own. The aws is connected and is working, however when I say "ramranch" in the testing console, Alexa responds with "Sorry, I don't know that". Their is no debug or error message.
/* eslint-disable func-names */
/* eslint-disable no-console */
const Alexa = require('ask-sdk');
const RamRanch = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'LaunchRequest'
|| (request.type === 'IntentRequest'
&& request.intent.name === 'handle');
},
handle(handlerInput) {
this.emit(':tell', "Let's enjoy a world's most beautiful composition, composed by the great, Sunil Syal, <audio src='https://my-apis.000webhostapp.com/audio/Romantic%20Solitude-Instrumental%20(Flute).mp3'/> Wow, That is amazing. Click the link on top right corner to listen to full song.");
}
}
const HelpHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest'
&& request.intent.name === 'AMAZON.HelpIntent';
},
handle(handlerInput) {
return handlerInput.responseBuilder
.speak(HELP_MESSAGE)
.reprompt(HELP_REPROMPT)
.getResponse();
},
};
const ExitHandler = {
canHandle(handlerInput) {
const request = handlerInput.requestEnvelope.request;
return request.type === 'IntentRequest'
&& (request.intent.name === 'AMAZON.CancelIntent'
|| request.intent.name === 'AMAZON.StopIntent');
json amazon-web-services alexa
json amazon-web-services alexa
New contributor
New contributor
New contributor
asked Dec 27 '18 at 15:28
Nuckers Buckers
61
61
New contributor
New contributor
maybe it doesn't think you're saying ramranch
– johnny 5
Dec 27 '18 at 17:31
ah well you see you actually type in the words into the console whenyour building/testing the skill.
– Nuckers Buckers
Dec 27 '18 at 17:37
add a comment |
maybe it doesn't think you're saying ramranch
– johnny 5
Dec 27 '18 at 17:31
ah well you see you actually type in the words into the console whenyour building/testing the skill.
– Nuckers Buckers
Dec 27 '18 at 17:37
maybe it doesn't think you're saying ramranch
– johnny 5
Dec 27 '18 at 17:31
maybe it doesn't think you're saying ramranch
– johnny 5
Dec 27 '18 at 17:31
ah well you see you actually type in the words into the console whenyour building/testing the skill.
– Nuckers Buckers
Dec 27 '18 at 17:37
ah well you see you actually type in the words into the console whenyour building/testing the skill.
– Nuckers Buckers
Dec 27 '18 at 17:37
add a comment |
1 Answer
1
active
oldest
votes
There is a strong likelihood that when you modified the blueprint skill you may have deleted the node modules. Here is a slightly modified version of your index.js code. Begin a node project npm init. next npm install ask-sdk. your project folder will now have node_modules, package-lock.json, and package.json add this index.js file.
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
const speechText = 'Welcome to the Alexa Skills Kit, you can say what about ramranch';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const RamranchIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'ramranchIntent';
},
handle(handlerInput) {
const speechText = 'Lets enjoy a worlds most beautiful composition, composed by the great, Sunil Syal, <audio src="https://my-apis.000webhostapp.com/audio/Romantic%20Solitude-Instrumental%20(Flute).mp3"/> Wow, That is amazing. Click the link on top right corner to listen to full song.';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const HelpIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent';
},
handle(handlerInput) {
const speechText = 'You can say what about Ramranch!';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const CancelAndStopIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent'
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent');
},
handle(handlerInput) {
const speechText = 'Goodbye!';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const SessionEndedRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest';
},
handle(handlerInput) {
//any cleanup logic goes here
return handlerInput.responseBuilder.getResponse();
}
};
const ErrorHandler = {
canHandle() {
return true;
},
handle(handlerInput, error) {
console.log(`Error handled: ${error.message}`);
return handlerInput.responseBuilder
.speak('Sorry, I can't understand the command. Please say again.')
.reprompt('Sorry, I can't understand the command. Please say again.')
.getResponse();
},
};
exports.handler = Alexa.SkillBuilders.custom()
.addRequestHandlers(
LaunchRequestHandler,
RamranchIntentHandler,
HelpIntentHandler,
CancelAndStopIntentHandler,
SessionEndedRequestHandler)
.addErrorHandlers(ErrorHandler)
.lambda();
Be sure to modify your Alexa skill developer model to include a ramranchIntent as I have not combined launch and primary intents as in your code. Lastly, zip this with the other previously mentioned files into your lambda function in AWS and add some intent phrases for triggering Ramranch, in my tests I used this skill JSON
{
"interactionModel": {
"languageModel": {
"invocationName": "ramranch player",
"intents": [
{
"name": "AMAZON.FallbackIntent",
"samples":
},
{
"name": "AMAZON.CancelIntent",
"samples":
},
{
"name": "AMAZON.HelpIntent",
"samples":
},
{
"name": "AMAZON.StopIntent",
"samples":
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples":
},
{
"name": "ramranchIntent",
"slots": ,
"samples": [
"what about ramranch",
"lets hear ramranch"
]
}
],
"types":
}
}
}
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Nuckers Buckers is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53947338%2falexa-skill-playing-audio-results-in-sorry-dont-know-that%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
There is a strong likelihood that when you modified the blueprint skill you may have deleted the node modules. Here is a slightly modified version of your index.js code. Begin a node project npm init. next npm install ask-sdk. your project folder will now have node_modules, package-lock.json, and package.json add this index.js file.
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
const speechText = 'Welcome to the Alexa Skills Kit, you can say what about ramranch';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const RamranchIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'ramranchIntent';
},
handle(handlerInput) {
const speechText = 'Lets enjoy a worlds most beautiful composition, composed by the great, Sunil Syal, <audio src="https://my-apis.000webhostapp.com/audio/Romantic%20Solitude-Instrumental%20(Flute).mp3"/> Wow, That is amazing. Click the link on top right corner to listen to full song.';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const HelpIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent';
},
handle(handlerInput) {
const speechText = 'You can say what about Ramranch!';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const CancelAndStopIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent'
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent');
},
handle(handlerInput) {
const speechText = 'Goodbye!';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const SessionEndedRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest';
},
handle(handlerInput) {
//any cleanup logic goes here
return handlerInput.responseBuilder.getResponse();
}
};
const ErrorHandler = {
canHandle() {
return true;
},
handle(handlerInput, error) {
console.log(`Error handled: ${error.message}`);
return handlerInput.responseBuilder
.speak('Sorry, I can't understand the command. Please say again.')
.reprompt('Sorry, I can't understand the command. Please say again.')
.getResponse();
},
};
exports.handler = Alexa.SkillBuilders.custom()
.addRequestHandlers(
LaunchRequestHandler,
RamranchIntentHandler,
HelpIntentHandler,
CancelAndStopIntentHandler,
SessionEndedRequestHandler)
.addErrorHandlers(ErrorHandler)
.lambda();
Be sure to modify your Alexa skill developer model to include a ramranchIntent as I have not combined launch and primary intents as in your code. Lastly, zip this with the other previously mentioned files into your lambda function in AWS and add some intent phrases for triggering Ramranch, in my tests I used this skill JSON
{
"interactionModel": {
"languageModel": {
"invocationName": "ramranch player",
"intents": [
{
"name": "AMAZON.FallbackIntent",
"samples":
},
{
"name": "AMAZON.CancelIntent",
"samples":
},
{
"name": "AMAZON.HelpIntent",
"samples":
},
{
"name": "AMAZON.StopIntent",
"samples":
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples":
},
{
"name": "ramranchIntent",
"slots": ,
"samples": [
"what about ramranch",
"lets hear ramranch"
]
}
],
"types":
}
}
}
add a comment |
There is a strong likelihood that when you modified the blueprint skill you may have deleted the node modules. Here is a slightly modified version of your index.js code. Begin a node project npm init. next npm install ask-sdk. your project folder will now have node_modules, package-lock.json, and package.json add this index.js file.
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
const speechText = 'Welcome to the Alexa Skills Kit, you can say what about ramranch';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const RamranchIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'ramranchIntent';
},
handle(handlerInput) {
const speechText = 'Lets enjoy a worlds most beautiful composition, composed by the great, Sunil Syal, <audio src="https://my-apis.000webhostapp.com/audio/Romantic%20Solitude-Instrumental%20(Flute).mp3"/> Wow, That is amazing. Click the link on top right corner to listen to full song.';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const HelpIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent';
},
handle(handlerInput) {
const speechText = 'You can say what about Ramranch!';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const CancelAndStopIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent'
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent');
},
handle(handlerInput) {
const speechText = 'Goodbye!';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const SessionEndedRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest';
},
handle(handlerInput) {
//any cleanup logic goes here
return handlerInput.responseBuilder.getResponse();
}
};
const ErrorHandler = {
canHandle() {
return true;
},
handle(handlerInput, error) {
console.log(`Error handled: ${error.message}`);
return handlerInput.responseBuilder
.speak('Sorry, I can't understand the command. Please say again.')
.reprompt('Sorry, I can't understand the command. Please say again.')
.getResponse();
},
};
exports.handler = Alexa.SkillBuilders.custom()
.addRequestHandlers(
LaunchRequestHandler,
RamranchIntentHandler,
HelpIntentHandler,
CancelAndStopIntentHandler,
SessionEndedRequestHandler)
.addErrorHandlers(ErrorHandler)
.lambda();
Be sure to modify your Alexa skill developer model to include a ramranchIntent as I have not combined launch and primary intents as in your code. Lastly, zip this with the other previously mentioned files into your lambda function in AWS and add some intent phrases for triggering Ramranch, in my tests I used this skill JSON
{
"interactionModel": {
"languageModel": {
"invocationName": "ramranch player",
"intents": [
{
"name": "AMAZON.FallbackIntent",
"samples":
},
{
"name": "AMAZON.CancelIntent",
"samples":
},
{
"name": "AMAZON.HelpIntent",
"samples":
},
{
"name": "AMAZON.StopIntent",
"samples":
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples":
},
{
"name": "ramranchIntent",
"slots": ,
"samples": [
"what about ramranch",
"lets hear ramranch"
]
}
],
"types":
}
}
}
add a comment |
There is a strong likelihood that when you modified the blueprint skill you may have deleted the node modules. Here is a slightly modified version of your index.js code. Begin a node project npm init. next npm install ask-sdk. your project folder will now have node_modules, package-lock.json, and package.json add this index.js file.
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
const speechText = 'Welcome to the Alexa Skills Kit, you can say what about ramranch';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const RamranchIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'ramranchIntent';
},
handle(handlerInput) {
const speechText = 'Lets enjoy a worlds most beautiful composition, composed by the great, Sunil Syal, <audio src="https://my-apis.000webhostapp.com/audio/Romantic%20Solitude-Instrumental%20(Flute).mp3"/> Wow, That is amazing. Click the link on top right corner to listen to full song.';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const HelpIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent';
},
handle(handlerInput) {
const speechText = 'You can say what about Ramranch!';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const CancelAndStopIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent'
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent');
},
handle(handlerInput) {
const speechText = 'Goodbye!';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const SessionEndedRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest';
},
handle(handlerInput) {
//any cleanup logic goes here
return handlerInput.responseBuilder.getResponse();
}
};
const ErrorHandler = {
canHandle() {
return true;
},
handle(handlerInput, error) {
console.log(`Error handled: ${error.message}`);
return handlerInput.responseBuilder
.speak('Sorry, I can't understand the command. Please say again.')
.reprompt('Sorry, I can't understand the command. Please say again.')
.getResponse();
},
};
exports.handler = Alexa.SkillBuilders.custom()
.addRequestHandlers(
LaunchRequestHandler,
RamranchIntentHandler,
HelpIntentHandler,
CancelAndStopIntentHandler,
SessionEndedRequestHandler)
.addErrorHandlers(ErrorHandler)
.lambda();
Be sure to modify your Alexa skill developer model to include a ramranchIntent as I have not combined launch and primary intents as in your code. Lastly, zip this with the other previously mentioned files into your lambda function in AWS and add some intent phrases for triggering Ramranch, in my tests I used this skill JSON
{
"interactionModel": {
"languageModel": {
"invocationName": "ramranch player",
"intents": [
{
"name": "AMAZON.FallbackIntent",
"samples":
},
{
"name": "AMAZON.CancelIntent",
"samples":
},
{
"name": "AMAZON.HelpIntent",
"samples":
},
{
"name": "AMAZON.StopIntent",
"samples":
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples":
},
{
"name": "ramranchIntent",
"slots": ,
"samples": [
"what about ramranch",
"lets hear ramranch"
]
}
],
"types":
}
}
}
There is a strong likelihood that when you modified the blueprint skill you may have deleted the node modules. Here is a slightly modified version of your index.js code. Begin a node project npm init. next npm install ask-sdk. your project folder will now have node_modules, package-lock.json, and package.json add this index.js file.
const Alexa = require('ask-sdk-core');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
const speechText = 'Welcome to the Alexa Skills Kit, you can say what about ramranch';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const RamranchIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'ramranchIntent';
},
handle(handlerInput) {
const speechText = 'Lets enjoy a worlds most beautiful composition, composed by the great, Sunil Syal, <audio src="https://my-apis.000webhostapp.com/audio/Romantic%20Solitude-Instrumental%20(Flute).mp3"/> Wow, That is amazing. Click the link on top right corner to listen to full song.';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const HelpIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'AMAZON.HelpIntent';
},
handle(handlerInput) {
const speechText = 'You can say what about Ramranch!';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const CancelAndStopIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& (handlerInput.requestEnvelope.request.intent.name === 'AMAZON.CancelIntent'
|| handlerInput.requestEnvelope.request.intent.name === 'AMAZON.StopIntent');
},
handle(handlerInput) {
const speechText = 'Goodbye!';
return handlerInput.responseBuilder
.speak(speechText)
.withSimpleCard('Ramranch', speechText)
.getResponse();
}
};
const SessionEndedRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'SessionEndedRequest';
},
handle(handlerInput) {
//any cleanup logic goes here
return handlerInput.responseBuilder.getResponse();
}
};
const ErrorHandler = {
canHandle() {
return true;
},
handle(handlerInput, error) {
console.log(`Error handled: ${error.message}`);
return handlerInput.responseBuilder
.speak('Sorry, I can't understand the command. Please say again.')
.reprompt('Sorry, I can't understand the command. Please say again.')
.getResponse();
},
};
exports.handler = Alexa.SkillBuilders.custom()
.addRequestHandlers(
LaunchRequestHandler,
RamranchIntentHandler,
HelpIntentHandler,
CancelAndStopIntentHandler,
SessionEndedRequestHandler)
.addErrorHandlers(ErrorHandler)
.lambda();
Be sure to modify your Alexa skill developer model to include a ramranchIntent as I have not combined launch and primary intents as in your code. Lastly, zip this with the other previously mentioned files into your lambda function in AWS and add some intent phrases for triggering Ramranch, in my tests I used this skill JSON
{
"interactionModel": {
"languageModel": {
"invocationName": "ramranch player",
"intents": [
{
"name": "AMAZON.FallbackIntent",
"samples":
},
{
"name": "AMAZON.CancelIntent",
"samples":
},
{
"name": "AMAZON.HelpIntent",
"samples":
},
{
"name": "AMAZON.StopIntent",
"samples":
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples":
},
{
"name": "ramranchIntent",
"slots": ,
"samples": [
"what about ramranch",
"lets hear ramranch"
]
}
],
"types":
}
}
}
answered Dec 28 '18 at 4:40
Chuck LaPress
16819
16819
add a comment |
add a comment |
Nuckers Buckers is a new contributor. Be nice, and check out our Code of Conduct.
Nuckers Buckers is a new contributor. Be nice, and check out our Code of Conduct.
Nuckers Buckers is a new contributor. Be nice, and check out our Code of Conduct.
Nuckers Buckers is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53947338%2falexa-skill-playing-audio-results-in-sorry-dont-know-that%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
maybe it doesn't think you're saying ramranch
– johnny 5
Dec 27 '18 at 17:31
ah well you see you actually type in the words into the console whenyour building/testing the skill.
– Nuckers Buckers
Dec 27 '18 at 17:37