PromptBuilder.StartStyle(PromptStyle) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Spécifie le début d’un style dans l’objet PromptBuilder .
public:
void StartStyle(System::Speech::Synthesis::PromptStyle ^ style);
public void StartStyle(System.Speech.Synthesis.PromptStyle style);
member this.StartStyle : System.Speech.Synthesis.PromptStyle -> unit
Public Sub StartStyle (style As PromptStyle)
Paramètres
- style
- PromptStyle
Style à démarrer.
Exemples
L’exemple suivant crée un PromptBuilder objet et ajoute des chaînes de texte. L’exemple utilise la StartStyle méthode pour spécifier un taux de parole lent pour la chaîne ajoutée, qui énumère le contenu d’une commande.
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();
}
}
}
Remarques
La StartStyle méthode prend un PromptStyle objet comme argument. Vous pouvez utiliser les propriétés de l’objet PromptStyle pour définir l’accentuation, la fréquence de parole et le volume (voix) pour s’appliquer à la sortie vocale pendant que le style est en vigueur. Pour arrêter d’utiliser le style actuel, appelez la EndStyle méthode.
Note
- Les moteurs de synthèse vocale dans Windows ne prennent pas en charge le paramètre d’accentuation pour l’instant. La définition de valeurs pour le paramètre d’accentuation ne produit aucune modification audible dans la sortie vocale synthétisée.
- 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.