PromptBuilder.AppendTextWithHint 메서드

정의

텍스트를 PromptBuilder 개체에 추가하고 텍스트의 콘텐츠 형식을 지정합니다.

오버로드

AppendTextWithHint(String, String)

텍스트를 PromptBuilder 개체에 추가하고 텍스트의 콘텐츠 형식을 지정하는 String을 추가합니다.

AppendTextWithHint(String, SayAs)

텍스트를 PromptBuilder 개체에 추가하고 SayAs 열거형의 멤버를 사용하여 콘텐츠 형식을 지정합니다.

AppendTextWithHint(String, String)

텍스트를 PromptBuilder 개체에 추가하고 텍스트의 콘텐츠 형식을 지정하는 String을 추가합니다.

public:
 void AppendTextWithHint(System::String ^ textToSpeak, System::String ^ sayAs);
public void AppendTextWithHint (string textToSpeak, string sayAs);
member this.AppendTextWithHint : string * string -> unit
Public Sub AppendTextWithHint (textToSpeak As String, sayAs As String)

매개 변수

textToSpeak
String

읽을 텍스트가 들어 있는 문자열입니다.

sayAs
String

텍스트의 콘텐츠 형식입니다.

설명

이 메서드를 사용 하 여 열거형에 포함 되지 않은 콘텐츠 형식을 지정할 수 있습니다 SayAs . 그러나 TTS 엔진은 사용자가 지정 하는 매개 변수를 지원 해야 합니다.

적용 대상

AppendTextWithHint(String, SayAs)

텍스트를 PromptBuilder 개체에 추가하고 SayAs 열거형의 멤버를 사용하여 콘텐츠 형식을 지정합니다.

public:
 void AppendTextWithHint(System::String ^ textToSpeak, System::Speech::Synthesis::SayAs sayAs);
public void AppendTextWithHint (string textToSpeak, System.Speech.Synthesis.SayAs sayAs);
member this.AppendTextWithHint : string * System.Speech.Synthesis.SayAs -> unit
Public Sub AppendTextWithHint (textToSpeak As String, sayAs As SayAs)

매개 변수

textToSpeak
String

읽을 텍스트가 들어 있는 문자열입니다.

sayAs
SayAs

텍스트의 콘텐츠 형식입니다.

예제

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.SetOutputToDefaultAudioDevice();  

        // Create a PromptBuilder object and define the data types for some of the added strings.  
        PromptBuilder sayAs = new PromptBuilder();  
        sayAs.AppendText("Your");  
        sayAs.AppendTextWithHint("1st", SayAs.NumberOrdinal);  
        sayAs.AppendText("request was for");  
        sayAs.AppendTextWithHint("1", SayAs.NumberCardinal);  
        sayAs.AppendText("room, on");  
        sayAs.AppendTextWithHint("10/19/2012,", SayAs.MonthDayYear);  
        sayAs.AppendText("with early arrival at");  
        sayAs.AppendTextWithHint("12:35pm", SayAs.Time12);  

        // Speak the contents of the SSML prompt.  
        synth.Speak(sayAs);  
      }  

      Console.WriteLine();  
      Console.WriteLine("Press any key to exit...");  
      Console.ReadKey();  
    }  
  }  
}  

설명

로 지정 된 콘텐츠 형식은 sayAs 음성 합성 엔진에 콘텐츠를 발음 하는 방법에 대 한 지침을 제공할 수 있습니다 textToSpeak .

적용 대상