PromptStyle Constructeurs

Définition

Initialise une nouvelle instance de la classe PromptStyle.

Surcharges

PromptStyle()

Initialise une nouvelle instance de la classe PromptStyle.

PromptStyle(PromptEmphasis)

Initialise une nouvelle instance de la classe PromptStyle et spécifie le paramètre pour l'importance du style.

PromptStyle(PromptRate)

Initialise une nouvelle instance de la classe PromptStyle et spécifie le paramètre pour la vitesse d'énonciation du style.

PromptStyle(PromptVolume)

Initialise une nouvelle instance de la classe PromptStyle et spécifie le paramètre pour la volume d'énonciation du style.

PromptStyle()

Source:
PromptStyle.cs
Source:
PromptStyle.cs
Source:
PromptStyle.cs

Initialise une nouvelle instance de la classe PromptStyle.

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

S’applique à

PromptStyle(PromptEmphasis)

Source:
PromptStyle.cs
Source:
PromptStyle.cs
Source:
PromptStyle.cs

Initialise une nouvelle instance de la classe PromptStyle et spécifie le paramètre pour l'importance du style.

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)

Paramètres

emphasis
PromptEmphasis

Configuration de l'importance du style.

Remarques

Les moteurs de synthèse vocale dans Windows ne prennent pas en charge les variations de l’accentuation de la sortie vocale pour l’instant. La définition de valeurs pour l’accentuation à l’aide d’un membre de l’énumération PromptEmphasis ne produit aucune modification audible dans la sortie vocale synthétisée.

S’applique à

PromptStyle(PromptRate)

Source:
PromptStyle.cs
Source:
PromptStyle.cs
Source:
PromptStyle.cs

Initialise une nouvelle instance de la classe PromptStyle et spécifie le paramètre pour la vitesse d'énonciation du style.

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)

Paramètres

rate
PromptRate

Configuration de la vitesse d'énonciation du style.

Exemples

L’exemple suivant crée un PromptBuilder objet et ajoute des chaînes de texte. L’exemple utilise le PromptStyle constructeur comme argument de la StartStyle méthode pour spécifier une vitesse de parole lente pour la chaîne ajoutée, qui énumère le contenu d’un ordre.

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

S’applique à

PromptStyle(PromptVolume)

Source:
PromptStyle.cs
Source:
PromptStyle.cs
Source:
PromptStyle.cs

Initialise une nouvelle instance de la classe PromptStyle et spécifie le paramètre pour la volume d'énonciation du style.

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)

Paramètres

volume
PromptVolume

Configuration du volume (profondeur sonore) du style.

Exemples

L’exemple suivant utilise le PromptStyle constructeur pour spécifier les paramètres de volume que le doit appliquer à la SpeechSynthesizer sortie vocale.

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

Remarques

Le Default paramètre pour PromptVolume est le volume complet, ce qui est identique à ExtraLoud. Les autres paramètres diminuent le volume de sortie vocale par rapport au volume complet.

Voir aussi

S’applique à