PromptStyle Constructores

Definición

Inicializa una nueva instancia de la clase PromptStyle.

Sobrecargas

PromptStyle()

Inicializa una nueva instancia de la clase PromptStyle.

PromptStyle(PromptEmphasis)

Inicializa una nueva instancia de la clase PromptStyle y especifica el valor para el énfasis del estilo.

PromptStyle(PromptRate)

Inicializa una nueva instancia de la clase PromptStyle y especifica el valor para la velocidad de habla del estilo.

PromptStyle(PromptVolume)

Inicializa una nueva instancia de la clase PromptStyle y especifica el valor para el volumen de habla del estilo.

PromptStyle()

Inicializa una nueva instancia de la clase PromptStyle.

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

Se aplica a

PromptStyle(PromptEmphasis)

Inicializa una nueva instancia de la clase PromptStyle y especifica el valor para el énfasis del 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

El valor para el énfasis del estilo.

Comentarios

Los motores de síntesis de voz de Windows no admiten variaciones en el énfasis de la salida de voz en este momento. La configuración de los valores de énfasis mediante un miembro de la PromptEmphasis enumeración no producirá ningún cambio audible en la salida de voz sintetizada.

Se aplica a

PromptStyle(PromptRate)

Inicializa una nueva instancia de la clase PromptStyle y especifica el valor para la velocidad de habla del 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

El valor para la velocidad de habla del estilo.

Ejemplos

En el ejemplo siguiente se crea un PromptBuilder objeto y se anexan cadenas de texto. En el ejemplo se usa el PromptStyle constructor como argumento para el StartStyle método con el fin de especificar una velocidad de habla lenta para la cadena que se va a agregar, que enumera el contenido de un pedido.

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

Se aplica a

PromptStyle(PromptVolume)

Inicializa una nueva instancia de la clase PromptStyle y especifica el valor para el volumen de habla del 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

El valor para el volumen (intensidad) del estilo.

Ejemplos

En el ejemplo siguiente se usa el PromptStyle constructor para especificar la configuración del volumen que SpeechSynthesizer se debe aplicar a la salida 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();  
    }  
  }  
}  

Comentarios

El Default valor de PromptVolume es volumen completo, que es el mismo que ExtraLoud . Las demás opciones reducen el volumen de salida de voz en relación con el volumen completo.

Consulte también

Se aplica a