Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. private async Task<SpeechletResponse> BuildSpeechletResponse(string title, string output, bool shouldEndSession)
  2. {
  3. // Create the Simple card content.
  4. SimpleCard card = new SimpleCard();
  5.  
  6. //This is what is shown in the Alexa app.
  7. card.Title = String.Format("SessionSpeechlet - {0}", title);
  8. card.Subtitle = String.Format("SessionSpeechlet - Sub Title");
  9. card.Content = String.Format("SessionSpeechlet - {0}", output);
  10.  
  11. // Create the SSML (Speech Synthesis Markup Language) output.
  12. SsmlOutputSpeech speech = new SsmlOutputSpeech();
  13. //By using SSML we can control pronunciation, pauses, numeric formatting, etc.
  14. speech.Ssml = string.Format("<speak>{0}</speak>", output);
  15.  
  16. // Create the speechlet response.
  17. SpeechletResponse response = new SpeechletResponse();
  18.  
  19. //We can chose to keep the session open. This is allows us to have conversations with Alexa and continue to get more data
  20. //for the task at hand.
  21. response.ShouldEndSession = shouldEndSession;
  22.  
  23. response.OutputSpeech = speech;
  24. response.Card = card;
  25. return response;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement