PromptBreak Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Enumerates values for intervals of prosodic separation (breaks) between word boundaries.
public enum class PromptBreak
public enum PromptBreak
type PromptBreak =
Public Enum PromptBreak
- Inheritance
Fields
ExtraLarge | 5 | Indicates an extra-large break. |
ExtraSmall | 1 | Indicates an extra-small break. |
Large | 4 | Indicates a large break. |
Medium | 3 | Indicates a medium break. |
None | 0 | Indicates no break. |
Small | 2 | Indicates a small break. |
Examples
The following example builds a prompt containing two sentences separated by a break and speaks the prompt to the default audio device on the computer.
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(PromptBreak.Medium);
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();
}
}
}
Remarks
The values in the PromptBreak enumeration represent a range of separation intervals (pauses) between word boundaries. The speech synthesis engine determines the exact duration of the interval. When a break is requested, one of these values is passed to the text-to-speech (TTS) engine, which contains a mapping between these values and the corresponding millisecond break values.
The value None
represents the absence of a pause between word boundaries and can be used to remove a break where one would normally occur. The remaining values are listed in order of increasing durations for breaks.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기