PromptBuilder.AppendBreak 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
개체 내용에 중단(일시 중지)을 PromptBuilder 삽입합니다.
오버로드
| Name | Description |
|---|---|
| AppendBreak() |
개체에 중단을 PromptBuilder 추가합니다. |
| AppendBreak(PromptBreak) |
개체에 중단을 PromptBuilder 추가하고 해당 강도(기간)를 지정합니다. |
| AppendBreak(TimeSpan) |
개체에 지정된 기간의 중단을 PromptBuilder 추가합니다. |
AppendBreak()
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
개체에 중단을 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)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
개체에 중단을 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
중단 기간을 나타냅니다.
예제
다음 예제에서는 중단으로 구분된 두 문장이 포함된 프롬프트를 빌드하고 재생을 위해 출력을 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)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
개체에 지정된 기간의 중단을 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();
}
}
}
설명
중단을 사용하여 단어 간의 일시 중지 또는 기타 프로소딕 경계를 제어할 수 있습니다. 중단은 선택 사항입니다. 중단이 없으면 신시사이저는 언어 컨텍스트에 따라 단어 간의 나누기를 결정합니다.