PhonemeReachedEventArgs PhonemeReachedEventArgs PhonemeReachedEventArgs PhonemeReachedEventArgs Class

Definición

Devuelve datos del evento PhonemeReached.Returns data from the PhonemeReached event.

public ref class PhonemeReachedEventArgs : System::Speech::Synthesis::PromptEventArgs
public class PhonemeReachedEventArgs : System.Speech.Synthesis.PromptEventArgs
type PhonemeReachedEventArgs = class
    inherit PromptEventArgs
Public Class PhonemeReachedEventArgs
Inherits PromptEventArgs
Herencia

Ejemplos

El siguiente ejemplo forma parte de una aplicación Windows Forms que escribe la información devuelta por PhonemeReached el evento en un cuadro de texto.The following example is part of a Windows Forms application that writes the information returned by the PhonemeReached event to a text box. Los fonemas son caracteres del alfabeto fonético internacional (IPA).The phonemes are characters from the International Phonetic Alphabet (IPA).

Nota

Los caracteres primero y último devueltos por son caracteres de apertura y cierre que incluyen, PhonemeReachedEventArgs pero que no representan fonemas que constituyen una palabra o frase.The first and last characters returned by PhonemeReachedEventArgs are opening and closing characters that enclose but do not represent phonemes that constitute a word or phrase. Este ejemplo devuelve cinco caracteres, pero solo los tres caracteres centrales son fonemas que representan la palabra "Theme": uno para el sonido "TH", uno para el sonido "e" y otro para el sonido "m".This example returns five characters, but only the middle three characters are phonemes that represent the word "theme": one for the "th" sound, one for the "e" sound, and one for the "m" sound .

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));  
    }  
  }  
}  

Comentarios

Un fonema es un componente básico del lenguaje escrito.A phoneme is a basic component of written language. Para obtener más información acerca de fonemas PhonemeReached, vea.For more information about phonemes, see PhonemeReached.

Propiedades

AudioPosition AudioPosition AudioPosition AudioPosition

Obtiene la posición de audio del fonema.Gets the audio position of the phoneme.

Cancelled Cancelled Cancelled Cancelled

Obtiene un valor que indica si se ha cancelado una operación asincrónica.Gets a value indicating whether an asynchronous operation has been canceled.

(Inherited from AsyncCompletedEventArgs)
Duration Duration Duration Duration

Obtiene la duración del fonema.Gets the duration of the phoneme.

Emphasis Emphasis Emphasis Emphasis

Obtiene el énfasis del fonema.Gets the emphasis of the phoneme.

Error Error Error Error

Obtiene un valor que indica el error que se produjo durante una operación asincrónica.Gets a value indicating which error occurred during an asynchronous operation.

(Inherited from AsyncCompletedEventArgs)
NextPhoneme NextPhoneme NextPhoneme NextPhoneme

Obtiene el fonema siguiente al fonema asociado al evento PhonemeReached.Gets the phoneme following the phoneme associated with the PhonemeReached event.

Phoneme Phoneme Phoneme Phoneme

Fonema asociado al evento PhonemeReached.The phoneme associated with the PhonemeReached event.

Prompt Prompt Prompt Prompt

Obtiene la petición asociada al evento.Gets the prompt associated with the event.

(Inherited from PromptEventArgs)
UserState UserState UserState UserState

Obtiene el identificador único de la tarea asincrónica.Gets the unique identifier for the asynchronous task.

(Inherited from AsyncCompletedEventArgs)

Métodos

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
RaiseExceptionIfNecessary() RaiseExceptionIfNecessary() RaiseExceptionIfNecessary() RaiseExceptionIfNecessary()

Genera una excepción proporcionada por el usuario si se ha producido un error en una operación asincrónica.Raises a user-supplied exception if an asynchronous operation failed.

(Inherited from AsyncCompletedEventArgs)
ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a