PromptBuilder.AppendSsml 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.
Ajoute un fichier SSML à un PromptBuilder objet.
Surcharges
| Nom | Description |
|---|---|
| AppendSsml(String) |
Ajoute le fichier SSML au chemin d’accès spécifié à l’objet PromptBuilder . |
| AppendSsml(Uri) |
Ajoute le fichier SSML à l’URI spécifié à l’objet PromptBuilder . |
| AppendSsml(XmlReader) |
Ajoute un |
AppendSsml(String)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
Ajoute le fichier SSML au chemin d’accès spécifié à l’objet PromptBuilder .
public:
void AppendSsml(System::String ^ path);
public void AppendSsml(string path);
member this.AppendSsml : string -> unit
Public Sub AppendSsml (path As String)
Paramètres
- path
- String
Chemin complet du fichier SSML à ajouter.
Exemples
L’exemple suivant crée un PromptBuilder objet et ajoute le contenu d’un fichier SSML à l’aide de la AppendSsml méthode.
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 append a file that defines an SSML prompt.
PromptBuilder ssmlFile = new PromptBuilder();
ssmlFile.AppendSsml("c:\\test\\Weather.ssml");
// Speak the contents of the SSML prompt.
synth.Speak(ssmlFile);
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
Voici le fichier SSML référencé par l’exemple précédent.
<?xml version="1.0" encoding="ISO-8859-1"?>
<speak version="1.0"
xmlns="http://www.w3.org/2001/10/synthesis"
xml:lang="en-US">
<s> The weather forecast for today is partly cloudy with some sun breaks. </s>
</speak>
Remarques
Le fichier SSML doit être un fichier au format XML conforme à la spécification SSML (Speech Synthesis Markup Language) Version 1.0 .
Vous pouvez également ajouter le balisage SSML en tant que chaîne à l’aide AppendSsmlMarkupde .
S’applique à
AppendSsml(Uri)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
Ajoute le fichier SSML à l’URI spécifié à l’objet PromptBuilder .
public:
void AppendSsml(Uri ^ ssmlFile);
public void AppendSsml(Uri ssmlFile);
member this.AppendSsml : Uri -> unit
Public Sub AppendSsml (ssmlFile As Uri)
Paramètres
- ssmlFile
- Uri
URI complet du fichier SSML à ajouter.
Exemples
L’exemple suivant crée un PromptBuilder objet et ajoute le contenu d’un fichier SSML à l’aide de la AppendSsml méthode.
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 append a file that defines an SSML prompt.
PromptBuilder ssmlFile = new PromptBuilder();
ssmlFile.AppendSsml(new Uri("c:\\test\\Weather.ssml"));
// Speak the contents of the SSML prompt.
synth.Speak(ssmlFile);
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
Voici le fichier SSML référencé par l’exemple précédent.
<?xml version="1.0" encoding="ISO-8859-1"?>
<speak version="1.0"
xmlns="http://www.w3.org/2001/10/synthesis"
xml:lang="en-US">
<s> The weather forecast for today is partly cloudy with some sun breaks. </s>
</speak>
Remarques
Le fichier SSML doit être un fichier au format XML conforme à la spécification SSML (Speech Synthesis Markup Language) Version 1.0 .
Vous pouvez également ajouter le balisage SSML en tant que chaîne à l’aide AppendSsmlMarkupde .
Important
L’appel de méthodes de cette classe avec des données non approuvées est un risque de sécurité. Appelez les méthodes de cette classe uniquement avec des données approuvées. Pour plus d’informations, consultez Valider toutes les entrées.
S’applique à
AppendSsml(XmlReader)
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
- Source:
- PromptBuilder.cs
Ajoute un XMLReader objet qui fait référence à une invite SSML à l’objet PromptBuilder .
public:
void AppendSsml(System::Xml::XmlReader ^ ssmlFile);
public void AppendSsml(System.Xml.XmlReader ssmlFile);
member this.AppendSsml : System.Xml.XmlReader -> unit
Public Sub AppendSsml (ssmlFile As XmlReader)
Paramètres
- ssmlFile
- XmlReader
Nom complet du fichier XML à ajouter.
Exemples
L’exemple suivant crée un PromptBuilder objet à partir d’un XmlReader objet qui fait référence à un fichier contenant le balisage SSML (Speech Synthesis Markup Language).
using System;
using System.Xml;
using System.IO;
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.SetOutputToWaveFile(@"C:\test\weather.wav");
// Create a SoundPlayer instance to play the output audio file.
System.Media.SoundPlayer m_SoundPlayer =
new System.Media.SoundPlayer(@"C:\test\weather.wav");
// Create the path to the SSML file.
string weatherFile = Path.GetFullPath("c:\\test\\Weather.xml");
PromptBuilder builder = null;
// Create an XML Reader from the file, create a PromptBuilder and
// append the XmlReader.
if (File.Exists(weatherFile))
{
XmlReader reader = XmlReader.Create(weatherFile);
builder = new PromptBuilder();
builder.AppendSsml(reader);
reader.Close();
}
// Speak the prompt and play back the output file.
synth.Speak(builder);
m_SoundPlayer.Play();
}
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
}
}
Remarques
Important
L’utilisation d’une instance de ce type avec des données non approuvées est un risque de sécurité. Utilisez cet objet uniquement avec des données approuvées. Pour plus d’informations, consultez Valider toutes les entrées.
Le fichier SSML doit être un fichier au format XML conforme à la spécification SSML (Speech Synthesis Markup Language) Version 1.0 .
Vous pouvez également ajouter le balisage SSML en tant que chaîne à l’aide AppendSsmlMarkupde .