Share via


PromptBuilder.AppendSsmlMarkup Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Appends SSML markup to a PromptBuilder.

Namespace: Microsoft.SpeechServer.Synthesis
Assembly: Microsoft.SpeechServer (in microsoft.speechserver.dll)

Syntax

'Declaration
<EditorBrowsableAttribute(EditorBrowsableState.Advanced)> _
Public Sub AppendSsmlMarkup ( _
    ssmlMarkup As String _
)
[EditorBrowsableAttribute(EditorBrowsableState.Advanced)] 
public void AppendSsmlMarkup (
    string ssmlMarkup
)

Parameters

  • ssmlMarkup
    The SSML markup to be appended.

Example

The following example assumes a prompt database containing the phrase "Welcome to Speech Server."

In each of the three StatementActivity objects, a welcome prompt is appended to a PromptBuilder and the PromptBuilder is set as the StatementActivityMainPrompt.

In the first StatementActivity, the welcome text is appended as text. This StatementActivity plays the pre-recorded prompt from the database.

In the second StatementActivity, the welcome text is appended as an SSML node. This StatementActivity also plays the pre-recorded prompt from the database.

In the third StatementActivity, the welcome text is also appended as an SSML node, but with the addition of SSML tags that cause the welcome text to be sent directly to the text-to-speech (TTS) engine, bypassing the prompt database.

        PromptBuilder pb = new PromptBuilder();
        static string SsmlNs = "\"http://schemas.microsoft.com/Speech/2003/03/PromptEngine\"";
        string SsmlStartOutTag = "<peml:prompt_output xmlns:peml=" + SsmlNs + ">";
        string SsmlEndOutTag = "</peml:prompt_output>";
. . .
        private void statementActivity1_TurnStarting(object sender, TurnStartingEventArgs e)
        {
            // Appending text to play the first pre-recorded prompt.
            pb.SetText("Welcome to Speech Server. ");
            statementActivity1.MainPrompt.AppendPromptBuilder(pb);
        }

        private void statementActivity2_TurnStarting(object sender, TurnStartingEventArgs e)
        {
            // Appending SSML markup to play the first pre-recorded prompt.
            pb.ClearContent();
            pb.AppendSsmlMarkup(SsmlStartOutTag);
            pb.AppendSsmlMarkup("Welcome to Speech Server. ");
            pb.AppendSsmlMarkup(SsmlEndOutTag);
            statementActivity2.MainPrompt.AppendPromptBuilder(pb);
        }

        private void statementActivity3_TurnStarting(object sender, TurnStartingEventArgs e)
        {
            // Appending SSML markup to bypass the first pre-recorded prompt.
            pb.ClearContent();
            pb.AppendSsmlMarkup(SsmlStartOutTag);
            pb.AppendSsmlMarkup("<peml:tts>");
            pb.AppendSsmlMarkup("Welcome to Speech Server. ");
            pb.AppendSsmlMarkup("</peml:tts>");
            pb.AppendSsmlMarkup(SsmlEndOutTag);
            statementActivity3.MainPrompt.AppendPromptBuilder(pb);
        }

Thread Safety

All public static (Shared in Visual Basic) members of this type are thread-safe. Instance members are not guaranteed to be thread-safe.

Platforms

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003, Windows Vista Ultimate Edition, Windows Vista Business Edition, Windows Vista Enterprise Edition

Target Platforms

Windows Server 2003

See Also

Reference

PromptBuilder Class
PromptBuilder Members
Microsoft.SpeechServer.Synthesis Namespace