PromptStyle Konstruktoren
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Initialisiert eine neue Instanz der PromptStyle-Klasse.
Überlädt
| Name | Beschreibung |
|---|---|
| PromptStyle() |
Initialisiert eine neue Instanz der PromptStyle-Klasse. |
| PromptStyle(PromptEmphasis) |
Initialisiert eine neue Instanz der PromptStyle Klasse und gibt die Einstellung für die Hervorhebung der Formatvorlage an. |
| PromptStyle(PromptRate) |
Initialisiert eine neue Instanz der PromptStyle Klasse und gibt die Einstellung für die Sprechrate der Formatvorlage an. |
| PromptStyle(PromptVolume) |
Initialisiert eine neue Instanz der PromptStyle Klasse und gibt die Einstellung für das sprechende Volume der Formatvorlage an. |
PromptStyle()
- Quelle:
- PromptStyle.cs
- 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
- Quelle:
- PromptStyle.cs
Initialisiert eine neue Instanz der PromptStyle Klasse und gibt die Einstellung für die Hervorhebung der Formatvorlage 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 Hervorhebung der Formatvorlage.
Hinweise
Die Sprachsynthesemodule in Windows unterstützen derzeit keine Variationen bei der Hervorhebung der Sprachausgabe. Das Festlegen von Werten für die Hervorhebung mithilfe eines Elements 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
- Quelle:
- PromptStyle.cs
Initialisiert eine neue Instanz der PromptStyle Klasse und gibt die Einstellung für die Sprechrate der Formatvorlage 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 Sprechrate des Stils.
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 Sprachrate 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
- Quelle:
- PromptStyle.cs
Initialisiert eine neue Instanz der PromptStyle Klasse und gibt die Einstellung für das sprechende Volume der Formatvorlage 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 die Lautstärke (Lautheit) des Stils.
Beispiele
Im folgenden Beispiel wird der PromptStyle Konstruktor verwendet, um Volumeeinstellungen anzugeben, die für die SpeechSynthesizer Sprachausgabe gelten 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 die vollständige Lautstärke ist identisch mit ExtraLoud. Die anderen Einstellungen verringern die Lautstärke der Sprachausgabe relativ zur vollen Lautstärke.