PromptStyle Konstruktoren

Definition

Initialisiert eine neue Instanz der PromptStyle-Klasse.

Überlädt

PromptStyle()

Initialisiert eine neue Instanz der PromptStyle-Klasse.

PromptStyle(PromptEmphasis)

Initialisiert eine neue Instanz der PromptStyle-Klasse und gibt die Einstellung für die Betonung des Stils an.

PromptStyle(PromptRate)

Initialisiert eine neue Instanz der PromptStyle-Klasse und gibt die Einstellung für die Sprechgeschwindigkeit des Stils an.

PromptStyle(PromptVolume)

Initialisiert eine neue Instanz der PromptStyle-Klasse und gibt die Einstellung für die Sprechlautstärke des Stils an.

PromptStyle()

Quelle:
PromptStyle.cs
Quelle:
PromptStyle.cs
Quelle:
PromptStyle.cs

Initialisiert eine neue Instanz der PromptStyle-Klasse.

public:
 PromptStyle();
public PromptStyle ();
Public Sub New ()

Gilt für:

PromptStyle(PromptEmphasis)

Quelle:
PromptStyle.cs
Quelle:
PromptStyle.cs
Quelle:
PromptStyle.cs

Initialisiert eine neue Instanz der PromptStyle-Klasse und gibt die Einstellung für die Betonung des Stils an.

public:
 PromptStyle(System::Speech::Synthesis::PromptEmphasis emphasis);
public PromptStyle (System.Speech.Synthesis.PromptEmphasis emphasis);
new System.Speech.Synthesis.PromptStyle : System.Speech.Synthesis.PromptEmphasis -> System.Speech.Synthesis.PromptStyle
Public Sub New (emphasis As PromptEmphasis)

Parameter

emphasis
PromptEmphasis

Die Einstellung für die Gewichtung des Formats.

Hinweise

Die Sprachsynthese-Engines in Windows unterstützen derzeit keine Variationen in der Betonung der Sprachausgabe. Das Festlegen von Werten für die Hervorhebung mit einem Member der PromptEmphasis Enumeration führt zu keiner hörbaren Änderung der synthetisierten Sprachausgabe.

Gilt für:

PromptStyle(PromptRate)

Quelle:
PromptStyle.cs
Quelle:
PromptStyle.cs
Quelle:
PromptStyle.cs

Initialisiert eine neue Instanz der PromptStyle-Klasse und gibt die Einstellung für die Sprechgeschwindigkeit des Stils an.

public:
 PromptStyle(System::Speech::Synthesis::PromptRate rate);
public PromptStyle (System.Speech.Synthesis.PromptRate rate);
new System.Speech.Synthesis.PromptStyle : System.Speech.Synthesis.PromptRate -> System.Speech.Synthesis.PromptStyle
Public Sub New (rate As PromptRate)

Parameter

rate
PromptRate

Die Einstellung für die Sprachrate des Formats.

Beispiele

Im folgenden Beispiel wird ein PromptBuilder -Objekt erstellt und Textzeichenfolgen angefügt. Im Beispiel wird der PromptStyle Konstruktor als Argument für die StartStyle -Methode verwendet, um eine langsame Sprechrate für die hinzugefügte Zeichenfolge anzugeben, die den Inhalt einer Reihenfolge aufzählt.

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();  
    }  
  }  
}  

Gilt für:

PromptStyle(PromptVolume)

Quelle:
PromptStyle.cs
Quelle:
PromptStyle.cs
Quelle:
PromptStyle.cs

Initialisiert eine neue Instanz der PromptStyle-Klasse und gibt die Einstellung für die Sprechlautstärke des Stils an.

public:
 PromptStyle(System::Speech::Synthesis::PromptVolume volume);
public PromptStyle (System.Speech.Synthesis.PromptVolume volume);
new System.Speech.Synthesis.PromptStyle : System.Speech.Synthesis.PromptVolume -> System.Speech.Synthesis.PromptStyle
Public Sub New (volume As PromptVolume)

Parameter

volume
PromptVolume

Die Einstellung für das Volumen (die Lautstärke) des Formats.

Beispiele

Im folgenden Beispiel wird der PromptStyle -Konstruktor verwendet, um Volumeeinstellungen anzugeben, die auf die SpeechSynthesizer Sprachausgabe angewendet werden sollen.

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 that applies different volume settings.  
        PromptBuilder builder = new PromptBuilder();  
        builder.StartStyle(new PromptStyle(PromptVolume.Default));  
        builder.AppendText("This is the default speaking volume.");  
        builder.EndStyle();  
        builder.AppendBreak();  
        builder.StartStyle(new PromptStyle(PromptVolume.ExtraLoud));  
        builder.AppendText("This is the extra-loud speaking volume.");  
        builder.EndStyle();  
        builder.AppendBreak();  
        builder.StartStyle(new PromptStyle(PromptVolume.Medium));  
        builder.AppendText("This is the medium speaking volume.");  
        builder.EndStyle();  

        // Speak the prompt.  
        synth.Speak(builder);  
      }  

      Console.WriteLine();  
      Console.WriteLine("Press any key to exit...");  
      Console.ReadKey();  
    }  
  }  
}  

Hinweise

Die Default Einstellung für PromptVolume ist die vollständige Lautstärke, die mit identisch ExtraLoudist. Die anderen Einstellungen verringern die Lautstärke der Sprachausgabe relativ zur vollen Lautstärke.

Weitere Informationen

Gilt für: