PhonemeReachedEventArgs Class
Returns data from the PhonemeReached event.
System.EventArgs
System.ComponentModel.AsyncCompletedEventArgs
System.Speech.Synthesis.PromptEventArgs
System.Speech.Synthesis.PhonemeReachedEventArgs
Namespace: System.Speech.Synthesis
Assembly: System.Speech (in System.Speech.dll)
The PhonemeReachedEventArgs type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | AudioPosition | Gets the audio position of the phoneme. |
![]() | Cancelled | Gets a value indicating whether an asynchronous operation has been canceled. (Inherited from AsyncCompletedEventArgs.) |
![]() | Duration | Gets the duration of the phoneme. |
![]() | Emphasis | Gets the emphasis of the phoneme. |
![]() | Error | Gets a value indicating which error occurred during an asynchronous operation. (Inherited from AsyncCompletedEventArgs.) |
![]() | NextPhoneme | Gets the phoneme following the phoneme associated with the PhonemeReached event. |
![]() | Phoneme | The phoneme associated with the PhonemeReached event. |
![]() | Prompt | Gets the prompt associated with the event. (Inherited from PromptEventArgs.) |
![]() | UserState | Gets the unique identifier for the asynchronous task. (Inherited from AsyncCompletedEventArgs.) |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | RaiseExceptionIfNecessary | Raises a user-supplied exception if an asynchronous operation failed. (Inherited from AsyncCompletedEventArgs.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
A phoneme is a basic component of written language. For more information about phonemes, see PhonemeReached.
The following example is part of a Windows Forms application that writes the information returned by the PhonemeReached event to a text box. The phonemes are characters from the International Phonetic Alphabet (IPA).
Note |
|---|
The first and last characters ( |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Speech.Synthesis; namespace PhonemeReached { public partial class Form1 : Form { public Form1() { InitializeComponent(); textBox1.Text = ""; } public void button1_Click(object sender, EventArgs e) { // Initialize a new instance of the SpeechSynthesizer. SpeechSynthesizer synth = new SpeechSynthesizer(); // Configure the audio output. synth.SetOutputToDefaultAudioDevice(); // Register for the PhonemeReached event. synth.PhonemeReached += new EventHandler<PhonemeReachedEventArgs>(synth_PhonemeReached); // Speak the contents of a string. synth.Speak("Theme"); } // Write information about each phoneme as it is reached. private void synth_PhonemeReached(object sender, PhonemeReachedEventArgs e) {textBox1.AppendText(string.Format( " Phoneme reached summary:" + Environment.NewLine + " Phoneme: {0}" + Environment.NewLine + " Audio Position: {1} mSec" + Environment.NewLine + " Duration: {2} mSec" + Environment.NewLine + " Emphasis: {3}" + Environment.NewLine + " Next Phoneme: {4}" + Environment.NewLine + Environment.NewLine, e.Phoneme, e.AudioPosition, e.Duration, e.Emphasis, e.NextPhoneme)); } } }
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.

) returned by