Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private async Task<SpeechletResponse> BuildSpeechletResponse(string title, string output, bool shouldEndSession)
- {
- // Create the Simple card content.
- SimpleCard card = new SimpleCard();
- //This is what is shown in the Alexa app.
- card.Title = String.Format("SessionSpeechlet - {0}", title);
- card.Subtitle = String.Format("SessionSpeechlet - Sub Title");
- card.Content = String.Format("SessionSpeechlet - {0}", output);
- // Create the SSML (Speech Synthesis Markup Language) output.
- SsmlOutputSpeech speech = new SsmlOutputSpeech();
- //By using SSML we can control pronunciation, pauses, numeric formatting, etc.
- speech.Ssml = string.Format("<speak>{0}</speak>", output);
- // Create the speechlet response.
- SpeechletResponse response = new SpeechletResponse();
- //We can chose to keep the session open. This is allows us to have conversations with Alexa and continue to get more data
- //for the task at hand.
- response.ShouldEndSession = shouldEndSession;
- response.OutputSpeech = speech;
- response.Card = card;
- return response;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement