PromptBreak 枚举
定义
枚举字边界之间韵律分离(中断)间隔的值。Enumerates values for intervals of prosodic separation (breaks) between word boundaries.
public enum class PromptBreak
public enum PromptBreak
type PromptBreak =
Public Enum PromptBreak
- 继承
字段
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. |
示例
下面的示例生成一个提示, 其中包含两个用中断分隔的句子, 并将提示讲述到计算机上的默认音频设备。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();
}
}
}
注解
PromptBreak枚举中的值表示单词边界之间的分隔间隔 (暂停) 范围。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. 当请求中断时, 这些值中的一个值将传递给文本语音转换 (TTS) 引擎, 其中包含这些值和相应的毫秒分隔符值之间的映射。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.
该值None
表示在单词边界之间缺少暂停, 并且可用于删除通常发生的中断。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.