PromptBuilder.AppendBreak 메서드

정의

PromptBuilder 개체의 내용에 중단(일시 중지)을 삽입합니다.

오버로드

AppendBreak()

PromptBuilder 개체에 중단을 추가합니다.

AppendBreak(PromptBreak)

PromptBuilder 개체에 중단을 추가하고 중단의 강도(기간)를 지정합니다.

AppendBreak(TimeSpan)

PromptBuilder 개체에 지정된 기간의 중단을 추가합니다.

AppendBreak()

PromptBuilder 개체에 중단을 추가합니다.

public:
 void AppendBreak();
public void AppendBreak ();
member this.AppendBreak : unit -> unit
Public Sub AppendBreak ()

예제

다음 예제에서는 바꿈으로 구분 된 두 문장을 포함 하는 프롬프트를 빌드하고 컴퓨터의 기본 오디오 디바이스에 대 한 프롬프트를 말합니다.

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 with two sentences separated by a break.  
        PromptBuilder builder = new PromptBuilder(  
          new System.Globalization.CultureInfo("en-US"));  
        builder.AppendText(  
          "Tonight's movie showings in theater A are at 5:45, 7:15, and 8:45.");  
        builder.AppendBreak();  
        builder.AppendText(  
          "Tonight's movie showings in theater B are at 5:15, 7:30, and 9:15.");  

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

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

설명

이 메서드는 중단 기간을 지정 하지 않습니다. 는 SpeechSynthesizer 언어적 컨텍스트를 기반으로 하는 기간 값을 결정 합니다.

적용 대상

AppendBreak(PromptBreak)

PromptBuilder 개체에 중단을 추가하고 중단의 강도(기간)를 지정합니다.

public:
 void AppendBreak(System::Speech::Synthesis::PromptBreak strength);
public void AppendBreak (System.Speech.Synthesis.PromptBreak strength);
member this.AppendBreak : System.Speech.Synthesis.PromptBreak -> unit
Public Sub AppendBreak (strength As PromptBreak)

매개 변수

strength
PromptBreak

중단 기간을 나타냅니다.

예제

다음 예제에서는 break로 구분 된 두 개의 문장이 포함 된 프롬프트를 작성 하 고 재생을 위해 출력을 WAV 파일로 보냅니다.

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\weather.wav");  

        // Create a SoundPlayer instance to play the output audio file.  
        System.Media.SoundPlayer m_SoundPlayer =  
          new System.Media.SoundPlayer(@"C:\test\weather.wav");  

        // Build a prompt with two sentences separated by a break.  
        PromptBuilder builder = new PromptBuilder(  
          new System.Globalization.CultureInfo("en-US"));  
        builder.AppendText(  
          "Tonight's movie showings in theater A are at 5:45, 7:15, and 8:45");  
        builder.AppendBreak(PromptBreak.Medium);  
        builder.AppendText(  
          "Tonight's movie showings in theater B are at 5:15, 7:15, and 9:15");  

        // Speak the prompt and play back the output file.  
        synth.Speak(builder);  
        m_SoundPlayer.Play();  
      }  

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

설명

값을 PromptBreak 열거형 단어 경계 간의 분리 간격으로 (일시 중지)의 범위를 나타냅니다. 음성 합성 엔진 간격의 정확한 기간을 결정합니다. 중단 요청 되 면 다음이 값 중 하나일 이러한 값과 해당 밀리초 중단 값 간의 매핑을 포함 하는 텍스트 음성 변환 (TTS) 엔진으로 전달 됩니다.

적용 대상

AppendBreak(TimeSpan)

PromptBuilder 개체에 지정된 기간의 중단을 추가합니다.

public:
 void AppendBreak(TimeSpan duration);
public void AppendBreak (TimeSpan duration);
member this.AppendBreak : TimeSpan -> unit
Public Sub AppendBreak (duration As TimeSpan)

매개 변수

duration
TimeSpan

틱 단위의 시간으로, 1틱은 100나노초에 해당합니다.

예제

다음 예제에서는 15,000,000 틱 (1.5 초)으로 나누기로 구분 된 두 문장을 포함 하는 프롬프트를 빌드하고 컴퓨터의 기본 오디오 디바이스에 대 한 프롬프트를 말합니다.

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 with two sentences separated by a break.  
        PromptBuilder builder = new PromptBuilder(  
          new System.Globalization.CultureInfo("en-US"));  
        builder.AppendText(  
          "Tonight's movie showings in theater A are at 5:45, 7:15, and 8:45");  
        builder.AppendBreak(new TimeSpan(15000000));  
        builder.AppendText(  
          "Tonight's movie showings in theater B are at 5:15, 7:15, and 9:15");  

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

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

설명

Break를 사용 하 여 일시 중지 또는 단어 간 다른 운율 적 경계가 경계를 제어할 수 있습니다. Break는 선택 사항입니다. 중단이 없으면 신시사이저는 언어 컨텍스트에 따라 단어 사이의 나누기를 결정 합니다.

적용 대상