PhonemeReachedEventArgs Classe

Definizione

Restituisce dati dall'evento PhonemeReached .

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
Ereditarietà

Esempio

L'esempio seguente fa parte di un'applicazione Windows Form che scrive le informazioni restituite dall'evento PhonemeReached in una casella di testo. I fonemi sono caratteri dell'alfabeto fonetico internazionale (IPA).

Annotazioni

I primi e gli ultimi caratteri restituiti da PhonemeReachedEventArgs sono caratteri di apertura e chiusura che racchiudono ma non rappresentano fonemi che costituiscono una parola o una frase. In questo esempio vengono restituiti cinque caratteri, ma solo i tre caratteri intermedi sono fonemi che rappresentano la parola "theme": uno per il suono "th", uno per il suono "e" e uno per il suono "m".

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

Commenti

Un phoneme è un componente di base del linguaggio scritto. Per altre informazioni sui fonemi, vedere PhonemeReached.

Proprietà

Nome Descrizione
AudioPosition

Ottiene la posizione audio del fonema.

Cancelled

Ottiene un valore che indica se un'operazione asincrona è stata annullata.

(Ereditato da AsyncCompletedEventArgs)
Duration

Ottiene la durata del fonema.

Emphasis

Ottiene l'enfasi del fonema.

Error

Ottiene un valore che indica l'errore che si è verificato durante un'operazione asincrona.

(Ereditato da AsyncCompletedEventArgs)
NextPhoneme

Ottiene il fonema che segue il fonema associato all'evento PhonemeReached .

Phoneme

Phoneme associato all'evento PhonemeReached .

Prompt

Ottiene il prompt associato all'evento.

(Ereditato da PromptEventArgs)
UserState

Ottiene l'identificatore univoco per l'attività asincrona.

(Ereditato da AsyncCompletedEventArgs)

Metodi

Nome Descrizione
Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
RaiseExceptionIfNecessary()

Genera un'eccezione fornita dall'utente se un'operazione asincrona non è riuscita.

(Ereditato da AsyncCompletedEventArgs)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a