PromptBreak 列舉

定義

字組界限之間韻律分隔 (分隔) 間隔的列舉值。

public enum class PromptBreak
public enum PromptBreak
type PromptBreak = 
Public Enum PromptBreak
繼承
PromptBreak

欄位

ExtraLarge 5

表示特大的分隔。

ExtraSmall 1

表示非常小的分隔。

Large 4

表示大的分隔。

Medium 3

表示中度的分隔。

None 0

表示不會分隔。

Small 2

表示小的分隔。

範例

下列範例會建置提示,其中包含兩個以中斷點分隔的句子,並將提示讀出電腦上的預設音訊裝置。

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 表示文字界限之間沒有暫停,而且可以用來移除一般會發生的中斷。 其餘值會依中斷的持續時間增加順序列出。

適用於

另請參閱