PromptBuilder.AppendSsml Method (String)
Appends the SSML file at the specified path to the PromptBuilder object.
Namespace: System.Speech.Synthesis
Assembly: System.Speech (in System.Speech.dll)
Parameters
- path
- Type: System.String
A fully qualified path to the SSML file to append.
The SSML file must be an XML-format file that conforms to the Speech Synthesis Markup Language (SSML) Version 1.0 specification.
You can also append SSML markup as a string using AppendSsmlMarkup.
The example that follows creates a PromptBuilder object and appends the contents of an SSML file using the AppendSsml method.
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(); } } }
The following is the SSML file that the preceding example references.
<?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>
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.