PromptStyle Construtores
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Inicializa uma nova instância da PromptStyle classe.
Sobrecargas
| Nome | Descrição |
|---|---|
| PromptStyle() |
Inicializa uma nova instância da PromptStyle classe. |
| PromptStyle(PromptEmphasis) |
Inicializa uma nova instância da PromptStyle classe e especifica o cenário para a ênfase do estilo. |
| PromptStyle(PromptRate) |
Inicializa uma nova instância da PromptStyle classe e especifica a definição para a taxa de fala do estilo. |
| PromptStyle(PromptVolume) |
Inicializa uma nova instância da PromptStyle classe e especifica a definição para o volume falado do estilo. |
PromptStyle()
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
Inicializa uma nova instância da PromptStyle classe.
public:
PromptStyle();
public PromptStyle();
Public Sub New ()
Aplica-se a
PromptStyle(PromptEmphasis)
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
Inicializa uma nova instância da PromptStyle classe e especifica o cenário para a ênfase do estilo.
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)
Parâmetros
- emphasis
- PromptEmphasis
O cenário para a ênfase do estilo.
Observações
Os motores de síntese de voz no Windows não suportam variações na ênfase da saída de voz neste momento. Definir valores para ênfase usando um elemento da PromptEmphasis enumeração não produzirá qualquer alteração audível na saída da fala sintetizada.
Aplica-se a
PromptStyle(PromptRate)
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
Inicializa uma nova instância da PromptStyle classe e especifica a definição para a taxa de fala do estilo.
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)
Parâmetros
- rate
- PromptRate
A definição para a frequência de fala do estilo.
Exemplos
O exemplo seguinte cria um PromptBuilder objeto e acrescenta cadeias de texto. O exemplo usa o PromptStyle construtor como argumento para o StartStyle método para especificar uma taxa de fala lenta para a cadeia a ser adicionada, que enumera o conteúdo de uma ordem.
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();
}
}
}
Aplica-se a
PromptStyle(PromptVolume)
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
- Origem:
- PromptStyle.cs
Inicializa uma nova instância da PromptStyle classe e especifica a definição para o volume falado do estilo.
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)
Parâmetros
- volume
- PromptVolume
A definição para o volume (volume) do estilo.
Exemplos
O exemplo seguinte usa o PromptStyle construtor para especificar definições de volume que devem SpeechSynthesizer ser aplicadas à saída de voz.
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();
}
}
}
Observações
A Default definição para PromptVolume é volume máximo, que é a mesma que ExtraLoud. As outras definições diminuem o volume de saída da fala em relação ao volume máximo.