PromptStyle Construtores

Definição

Inicializa uma nova instância da classe PromptStyle.

Sobrecargas

PromptStyle()

Inicializa uma nova instância da classe PromptStyle.

PromptStyle(PromptEmphasis)

Inicializa uma nova instância da classe PromptStyle e especifica a configuração para a ênfase do estilo.

PromptStyle(PromptRate)

Inicializa uma nova instância da classe PromptStyle e especifica a configuração para a velocidade da fala do estilo.

PromptStyle(PromptVolume)

Inicializa uma nova instância da classe PromptStyle e especifica a configuração para o volume da fala do estilo.

PromptStyle()

Origem:
PromptStyle.cs
Origem:
PromptStyle.cs
Origem:
PromptStyle.cs

Inicializa uma nova instância da classe PromptStyle.

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

Aplica-se a

PromptStyle(PromptEmphasis)

Origem:
PromptStyle.cs
Origem:
PromptStyle.cs
Origem:
PromptStyle.cs

Inicializa uma nova instância da classe PromptStyle e especifica a configuração 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

A configuração para a ênfase do estilo.

Comentários

Os mecanismos de síntese de fala no Windows não dão suporte a variações na ênfase da saída de fala no momento. Definir valores para ênfase usando um membro da PromptEmphasis enumeração não produzirá nenhuma alteração audível na saída de fala sintetizada.

Aplica-se a

PromptStyle(PromptRate)

Origem:
PromptStyle.cs
Origem:
PromptStyle.cs
Origem:
PromptStyle.cs

Inicializa uma nova instância da classe PromptStyle e especifica a configuração para a velocidade da 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 configuração para a velocidade da fala do estilo.

Exemplos

O exemplo a seguir cria um PromptBuilder objeto e acrescenta cadeias de caracteres de texto. O exemplo usa o PromptStyle construtor como um argumento para o StartStyle método para especificar uma taxa de fala lenta para a cadeia de caracteres que está sendo 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

Inicializa uma nova instância da classe PromptStyle e especifica a configuração para o volume da fala 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 configuração para o volume (intensidade) do estilo.

Exemplos

O exemplo a seguir usa o PromptStyle construtor para especificar as configurações de volume que o SpeechSynthesizer deve aplicar à saída de fala.

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

Comentários

A Default configuração para PromptVolume é volume completo, que é o mesmo ExtraLoudque . As outras configurações diminuem o volume de saída de fala em relação ao volume completo.

Confira também

Aplica-se a