PromptBuilder.AppendPromptBuilder(PromptBuilder) 메서드

정의

PromptBuilder 개체를 다른 PromptBuilder 개체에 추가합니다.Appends a PromptBuilder object to another PromptBuilder object.

public:
 void AppendPromptBuilder(System::Speech::Synthesis::PromptBuilder ^ promptBuilder);
public void AppendPromptBuilder (System.Speech.Synthesis.PromptBuilder promptBuilder);
member this.AppendPromptBuilder : System.Speech.Synthesis.PromptBuilder -> unit

매개 변수

promptBuilder
PromptBuilder

추가할 콘텐츠입니다.The content to append.

예제

다음 예제에서는 두 개를 만듭니다 PromptBuilder 인스턴스를 세 번째 추가 합니다 PromptBuilder합니다.The example that follows creates two PromptBuilder instances and then appends them to a third PromptBuilder.

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.   
        synth.SetOutputToWaveFile(@"C:\test\showtimes.wav");  
  
        // Create a SoundPlayer instance to play the output audio file.  
        System.Media.SoundPlayer m_SoundPlayer =  
          new System.Media.SoundPlayer(@"C:\test\showtimes.wav");  
  
        // Build child prompts.  
        PromptBuilder theatreA = new PromptBuilder();  
        theatreA.AppendText(  
          "Tonight's movie showings in theater A are at 5:45, 7:15, and 9:30");  
        theatreA.AppendBreak(PromptBreak.Large);  
        PromptBuilder theatreB = new PromptBuilder();  
        theatreB.AppendText(  
          "Tonight's movie showings in theater B are at 5:15, 7:15, and 9:15");  
  
        // Build the parent prompt and append the two child prompts.  
        PromptBuilder showTimes = new PromptBuilder(  
          new System.Globalization.CultureInfo("en-US"));  
        showTimes.AppendText(  
          "The following are the show times for tonight's movies:");  
        showTimes.AppendPromptBuilder(theatreA);  
        showTimes.AppendPromptBuilder(theatreB);  
  
        // Speak the prompt and play back the output file.  
        synth.Speak(showTimes);  
        m_SoundPlayer.Play();  
      }  
  
      Console.WriteLine();  
      Console.WriteLine("Press any key to exit...");  
      Console.ReadKey();  
    }  
  }  
}  
  

적용 대상