PromptBuilder.ToXml 메서드


PromptBuilder 개체에서 생성된 SSML을 반환합니다.Returns the SSML generated from the PromptBuilder object.

 System::String ^ ToXml();
public string ToXml ();
member this.ToXml : unit -> string
Public Function ToXml () As String


SSML에서 생성되는 반환은 PromptBuilder 개체에서는 한 줄로.Returns the SSML generated from the PromptBuilder object as a single line.


다음 예제에서는 PromptBuilder 개체 텍스트를 추가 하 고 프롬프트의 내용을 하기 전에 프롬프트의 SSML 해당을 콘솔에 씁니다.The following example creates a PromptBuilder object, appends text, and then writes the SSML equivalent of the prompt to the console before speaking the contents of the prompt.

using System;  
using System.Speech.Synthesis;  
namespace SampleSynthesis  
  class Program  
    static void Main(string[] args)  
      // Initialize a new instance of the SpeechSynthesizer.  
      using (SpeechSynthesizer synth = new SpeechSynthesizer())  
        // Configure the audio output.   
        // Create a PromptBuilder object and add content.  
        PromptBuilder style = new PromptBuilder();  
        style.AppendText("Your order for");  
        style.StartStyle(new PromptStyle(PromptRate.Slow));  
        style.AppendText("one kitchen sink and one faucet");  
        style.AppendText("has been confirmed.");  
        // Write the contents of the PromptBuilder object to the console as  
        // an SSML-compatible XML file.  
        string myXml = style.ToXml();  
        Console.WriteLine("This is the SSML equivalent of the PromptBuilder: \n\n" + myXml);  
        // Speak the contents of the SSML prompt.  
      Console.WriteLine("Press any key to exit...");  


ToXml 메서드에서는 어떤 방식으로 반환 된 SSML 형식을 지정 하지 않습니다.The ToXml method makes no attempt to format the returned SSML in any way.

적용 대상