PhonemeReachedEventArgs クラス

定義

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
継承

次の例は、イベントによって返される情報をテキスト ボックスに書き込むWindows フォーム アプリケーションのPhonemeReached一部です。 音素は国際 音素アルファベット (IPA) の文字です。

Note

によって PhonemeReachedEventArgs 返される最初の文字と最後の文字は、単語または語句を構成する音素を表さない開始文字と終了文字です。 次の使用例は 5 文字を返しますが、"theme" という単語を表す音素は中央の 3 文字のみです。1 つは "th" サウンド用、もう 1 つは "e" サウンド用、もう 1 つは "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));  
    }  
  }  
}  

注釈

音素は、書かれた言語の基本的なコンポーネントです。 音素の詳細については、「」を参照してください PhonemeReached

プロパティ

AudioPosition

音素のオーディオの位置を取得します。

Cancelled

非同期操作がキャンセルされたかどうかを示す値を取得します。

(継承元 AsyncCompletedEventArgs)
Duration

音素の継続時間を取得します。

Emphasis

音素の強勢を取得します。

Error

非同期操作中に発生したエラーを示す値を取得します。

(継承元 AsyncCompletedEventArgs)
NextPhoneme

PhonemeReached イベントに関連付けられた音素の次の音素を取得します。

Phoneme

PhonemeReached イベントに関連付けられている音素。

Prompt

イベントに関連付けられているプロンプトを取得します。

(継承元 PromptEventArgs)
UserState

非同期タスクの一意の識別子を取得します。

(継承元 AsyncCompletedEventArgs)

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
RaiseExceptionIfNecessary()

非同期操作が失敗した場合は、ユーザー指定の例外を発生させます。

(継承元 AsyncCompletedEventArgs)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象