Beispiel #1
0
        public void TestMixedContent()
        {
            var elem = new Say();

            elem.AddText("before")
            .AddChild("Child").AddText("content");
            elem.AddText("after");

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<Say>before<Child>content</Child>after</Say>",
                elem.ToString()
                );
        }
Beispiel #2
0
    static void Main()
    {
        var response = new VoiceResponse();
        var say = new Say("Hi", voice: "Polly.Joanna");
        say.SsmlBreak(strength: "x-weak", time: "100ms");
        say.SsmlEmphasis("Words to emphasize", level: "moderate");
        say.SsmlP("Words to speak");
        say.AddText("aaaaaa");
        say.SsmlPhoneme("Words to speak", alphabet: "x-sampa", ph: "pɪˈkɑːn");
        say.AddText("bbbbbbb");
        say.SsmlProsody("Words to speak", pitch: "-10%", rate: "85%",
            volume: "-6dB");
        say.SsmlS("Words to speak");
        say.SsmlSayAs("Words to speak", interpretAs: "spell-out");
        say.SsmlSub("Words to be substituted", alias: "alias");
        say.SsmlW("Words to speak");
        response.Append(say);

        Console.WriteLine(response.ToString());
    }
Beispiel #3
0
        public void TestElementWithTextNode()
        {
            var elem = new Say();

            elem.AddText("Here is the content");

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<Say>Here is the content</Say>",
                elem.ToString()
                );
        }