Langue

PromptStyle Constructeurs

Définition

Initialise une nouvelle instance de la classe PromptStyle.

Surcharges

Nom Description
PromptStyle()

Initialise une nouvelle instance de la classe PromptStyle.

PromptStyle(PromptEmphasis)

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

PromptStyle(PromptRate)

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

PromptStyle(PromptVolume)

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

PromptStyle()

Source:
PromptStyle.cs
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
Source:
PromptStyle.cs

Initialise une nouvelle instance de la PromptStyle classe et spécifie le paramètre pour l’accentuation 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

Paramètre pour l’accentuation 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 des valeurs d’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
Source:
PromptStyle.cs

Initialise une nouvelle instance de la PromptStyle classe et spécifie le paramètre pour le taux de parole 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

Paramètre du taux de parole 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 un taux de parole lent 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
Source:
PromptStyle.cs

Initialise une nouvelle instance de la PromptStyle classe et spécifie le paramètre pour le volume parlant 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

Paramètre du volume (forte intensité) du style.

Exemples

L’exemple suivant utilise le PromptStyle constructeur pour spécifier les paramètres de volume à 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 le volume complet, qui est le même que ExtraLoud. Les autres paramètres diminuent le volume de sortie vocale par rapport au volume complet.

Voir aussi

S’applique à