PromptBuilder.StartStyle(PromptStyle) 方法   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定 PromptBuilder 对象中的样式开始。
public:
 void StartStyle(System::Speech::Synthesis::PromptStyle ^ style);public void StartStyle(System.Speech.Synthesis.PromptStyle style);member this.StartStyle : System.Speech.Synthesis.PromptStyle -> unitPublic Sub StartStyle (style As PromptStyle)参数
- style
- PromptStyle
要开始的样式。
示例
以下示例创建一个 PromptBuilder 对象并追加文本字符串。 该示例使用 StartStyle 方法为要添加的字符串指定缓慢的语速,以枚举订单的内容。
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();
        // Create a PromptBuilder object and add content.
        PromptBuilder style = new PromptBuilder();
        style.AppendText("Your order for");
        style.StartStyle(new PromptStyle(PromptRate.Slow));
        style.AppendText("one kitchen sink and one faucet");
        style.EndStyle();
        style.AppendText("has been confirmed.");
        // Speak the contents of the SSML prompt.
        synth.Speak(style);
      }
      Console.WriteLine();
      Console.WriteLine("Press any key to exit...");
      Console.ReadKey();
    }
  }
}
注解
方法 StartStyle 采用 PromptStyle 对象作为其参数。 可以使用 对象的属性 PromptStyle 设置重点、语速和音量 (响度) ,以在样式生效时应用于语音输出。 若要停止使用当前样式,请调用 EndStyle 方法。
注意
- Windows 中的语音合成引擎目前不支持强调参数。 设置强调参数的值不会在合成的语音输出中产生任何声音变化。
- 的 DefaultPromptVolume 设置为 full volume,这与 ExtraLoud相同。 其他设置将相对于完整音量减少语音输出的音量。