PromptBuilder.AppendText 메서드

정의

개체에 텍스트를 PromptBuilder 추가합니다.

오버로드

Name Description
AppendText(String)

개체에 추가할 PromptBuilder 텍스트를 지정합니다.

AppendText(String, PromptEmphasis)

개체에 PromptBuilder 텍스트를 추가하고 텍스트에 대한 강조도를 지정합니다.

AppendText(String, PromptRate)

개체에 텍스트를 추가하고 텍스트의 PromptBuilder 말하기 속도를 지정합니다.

AppendText(String, PromptVolume)

개체에 PromptBuilder 텍스트를 추가하고 텍스트를 말할 볼륨을 지정합니다.

AppendText(String)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

개체에 추가할 PromptBuilder 텍스트를 지정합니다.

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

매개 변수

textToSpeak
String

말할 텍스트가 들어 있는 문자열입니다.

예제

다음 예제에서는 개체를 PromptBuilder 만들고 메서드를 사용하여 텍스트 문자열을 AppendText 추가합니다.

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 append a text string.
        PromptBuilder speakText = new PromptBuilder();
        speakText.AppendText("Say the name of the song you want to hear");

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

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

설명

SSML 태그 언어로 서식이 지정된 텍스트를 추가하려면 .를 사용합니다 AppendSsmlMarkup.

적용 대상

AppendText(String, PromptEmphasis)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

개체에 PromptBuilder 텍스트를 추가하고 텍스트에 대한 강조도를 지정합니다.

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

매개 변수

textToSpeak
String

말할 텍스트가 들어 있는 문자열입니다.

emphasis
PromptEmphasis

텍스트에 적용할 강조 또는 스트레스 값입니다.

설명

Windows 음성 합성 엔진은 현재 강조 매개 변수를 지원하지 않습니다. 강조 매개 변수에 대한 값을 설정하면 합성된 음성 출력에서 가청 변경 내용이 생성되지 않습니다.

적용 대상

AppendText(String, PromptRate)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

개체에 텍스트를 추가하고 텍스트의 PromptBuilder 말하기 속도를 지정합니다.

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

매개 변수

textToSpeak
String

말할 텍스트가 들어 있는 문자열입니다.

rate
PromptRate

텍스트에 적용할 말하기 속도의 값입니다.

예제

다음 예제에서는 개체를 PromptBuilder 만들고 텍스트 문자열을 추가합니다. 이 예제에서는 메서드를 AppendText 사용하여 추가되는 문자열에 대해 느린 말하기 속도를 지정하여 주문 내용을 열거합니다.

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 add content.
        PromptBuilder speakRate = new PromptBuilder();
        speakRate.AppendText("Your order for");
        speakRate.AppendText("one kitchen sink and one faucet", PromptRate.Slow);
        speakRate.AppendText("has been confirmed.");

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

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

적용 대상

AppendText(String, PromptVolume)

Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs
Source:
PromptBuilder.cs

개체에 PromptBuilder 텍스트를 추가하고 텍스트를 말할 볼륨을 지정합니다.

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

매개 변수

textToSpeak
String

말할 텍스트가 들어 있는 문자열입니다.

volume
PromptVolume

텍스트에 적용할 말하기 볼륨(음량)의 값입니다.

예제

다음 예제에서는 메서드를 AppendText 사용하여 음성 출력에 SpeechSynthesizer 적용해야 하는 볼륨 설정을 지정합니다.

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

        // Build a prompt that applies different volume settings.
        PromptBuilder builder = new PromptBuilder();
        builder.AppendText("This is the default speaking volume.", PromptVolume.Default);
        builder.AppendBreak();
        builder.AppendText("This is the extra loud speaking volume.", PromptVolume.ExtraLoud);
        builder.AppendBreak();
        builder.AppendText("This is the medium speaking volume.", PromptVolume.Medium);

        // Speak the prompt.
        synth.Speak(builder);
      }

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

설명

에 대한 설정은 Default 전체 볼륨이며, 이는 .와 동일합니다PromptVolume.ExtraLoud 다른 설정은 전체 볼륨을 기준으로 음성 출력 볼륨을 줄입니다.

적용 대상