PromptBuilder::StartParagraph Method ()
.NET Framework (current version)
Specifies the start of a paragraph in the PromptBuilder object.
Assembly: System.Speech (in System.Speech.dll)
Long prompts can be rendered more like human speech if they are broken into sentences and paragraphs.
The following example creates a PromptBuilder object, appends content, and organizes the content into paragraphs and sentences.
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 as paragraphs and sentences. PromptBuilder parSent = new PromptBuilder(); parSent.StartParagraph(); parSent.StartSentence(); parSent.AppendText("Introducing the sentence element."); parSent.EndSentence(); parSent.StartSentence(); parSent.AppendText("You can use it to mark individual sentences."); parSent.EndSentence(); parSent.EndParagraph(); parSent.StartParagraph(); parSent.AppendText("Another simple paragraph. Sentence structure in this paragraph" + "is not explicitly marked."); parSent.EndParagraph(); // Speak the contents of the SSML prompt. synth.Speak(parSent); } Console.WriteLine(); Console.WriteLine("Press any key to exit..."); Console.ReadKey(); } } }
.NET Framework
Available since 3.0
Available since 3.0
Show: