PromptBreak 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
列舉字邊界之間間隔(中斷)間隔的值。
public enum class PromptBreak
public enum PromptBreak
type PromptBreak =
Public Enum PromptBreak
- 繼承
欄位
| 名稱 | 值 | Description |
|---|---|---|
| None | 0 | 表示沒有休息。 |
| ExtraSmall | 1 | 表示有超小的休息時間。 |
| Small | 2 | 表示有小小的休息。 |
| Medium | 3 | 表示中斷。 |
| Large | 4 | 表示有很大的斷裂。 |
| ExtraLarge | 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(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 數值代表詞界間的分隔區間(停頓)。 語音合成引擎決定該間隔的精確持續時間。 當請求中斷時,其中一個值會傳給文字轉語音(TTS)引擎,該引擎包含這些值與相應毫秒中斷值之間的對應。
這個值 None 代表詞界間沒有停頓,可以用來消除原本會出現的中斷。 其餘數值依休息時間遞增的順序列出。