Beispiel #1
0
        public SkillResponse ReturnOutputSpeech(string title, string resp, bool endSession, CardType cardType)
        {
            PlainTextOutputSpeech plainText = new PlainTextOutputSpeech();

            plainText.Type = "PlainText";
            plainText.Text = resp;
            ICard card = new SimpleCard();

            if (cardType == CardType.SimpleCard)
            {
                card = new SimpleCard();
                ((SimpleCard)card).title   = title;
                ((SimpleCard)card).content = plainText.Text;
            }
            else if (cardType == CardType.LinkedAccount)
            {
                card = new LinkAccount();
            }

            Response response = new Response();

            response.ShouldEndSession = endSession;
            response.Card             = card;
            response.OutputSpeech     = plainText;
            SkillResponse skillResponse = new SkillResponse();

            skillResponse.Response = response;
            skillResponse.Version  = "1.0";

            return(skillResponse);
        }
Beispiel #2
0
        public SkillResponse ReturnOutputSSML(string title, string resp, bool endSession)
        {
            PlainTextOutputSpeech plainText = new PlainTextOutputSpeech();

            plainText.Type = "SSML";
            plainText.SSML = resp;
            SimpleCard card = new SimpleCard();

            card.title   = title;
            card.content = "";
            Response response = new Response();

            response.ShouldEndSession = endSession;
            response.Card             = card;
            response.OutputSpeech     = plainText;
            SkillResponse skillResponse = new SkillResponse();

            skillResponse.Response = response;
            skillResponse.Version  = "1.0";

            return(skillResponse);
        }