VoiceInfo クラス

定義

インストールされた音声合成エンジンを表します。

public ref class VoiceInfo
[System.Serializable]
public class VoiceInfo
[<System.Serializable>]
type VoiceInfo = class
Public Class VoiceInfo
継承
VoiceInfo
属性

次の例は、オブジェクトを初期化 SpeechSynthesizer し、インストールされている音声 (音声合成用エンジン) の一覧をコンソールに出力し、各音声で使用できる情報を示すコンソール アプリケーションの一部です。

using System;  
using System.Speech.Synthesis;  
using System.Speech.AudioFormat;  

namespace SampleSynthesis  
{  
  class Program  
  {  
    static void Main(string[] args)  
    {  

      // Initialize a new instance of the SpeechSynthesizer.  
      using (SpeechSynthesizer synth = new SpeechSynthesizer())  
      {  

        // Output information about all of the installed voices.   
        Console.WriteLine("Installed voices -");  
        foreach (InstalledVoice voice in synth.GetInstalledVoices())  
        {  
          VoiceInfo info = voice.VoiceInfo;  
          string AudioFormats = "";  
          foreach (SpeechAudioFormatInfo fmt in info.SupportedAudioFormats)  
          {  
            AudioFormats += String.Format("{0}\n",  
            fmt.EncodingFormat.ToString());  
          }  

          Console.WriteLine(" Name:          " + info.Name);  
          Console.WriteLine(" Culture:       " + info.Culture);  
          Console.WriteLine(" Age:           " + info.Age);  
          Console.WriteLine(" Gender:        " + info.Gender);  
          Console.WriteLine(" Description:   " + info.Description);  
          Console.WriteLine(" ID:            " + info.Id);  
          Console.WriteLine(" Enabled:       " + voice.Enabled);  
          if (info.SupportedAudioFormats.Count != 0)  
          {  
            Console.WriteLine( " Audio formats: " + AudioFormats);  
          }  
          else  
          {  
            Console.WriteLine(" No supported audio formats found");  
          }  

          string AdditionalInfo = "";  
          foreach (string key in info.AdditionalInfo.Keys)  
          {  
            AdditionalInfo += String.Format("  {0}: {1}\n", key, info.AdditionalInfo[key]);  
          }  

          Console.WriteLine(" Additional Info - " + AdditionalInfo);  
          Console.WriteLine();  
        }  
      }  
      Console.WriteLine("Press any key to exit...");  
      Console.ReadKey();  
    }  
  }  
}  

注釈

音声は、インストールされている音声合成エンジンであり、テキスト読み上げエンジンまたは TTS エンジンとも呼ばれます。 オブジェクトは SpeechSynthesizer 音声を使用してテキストから音声を生成します。 オブジェクトのプロパティは、 VoiceInfo 音声を識別し、その特性を記述します。 音声の最も決定的な特徴は Culture、音声が話すことができる 1 つの言語を定義する です。

プロパティは VoiceVoiceInfo によって使用されている現在の音声に関する情報を含む オブジェクトを SpeechSynthesizer返します。 オブジェクトを VoiceInfo 使用して、 メソッドによって返される、システムにインストールされている音声に関する情報を GetInstalledVoices() 取得することもできます。 詳細については、「InstalledVoice」を参照してください。

プロパティ

AdditionalInfo

音声についての追加情報を取得します。

Age

音声の年齢を取得します。

Culture

音声のカルチャを取得します。

Description

音声の説明を取得します。

Gender

音声の性別を取得します。

Id

音声の ID を取得します。

Name

音声の名前を取得します。

SupportedAudioFormats

音声がサポートするオーディオ形式のコレクションを取得します。

メソッド

Equals(Object)

指定された VoiceInfo のオブジェクトを使用して音声のフィールドを比較し、同じ値を持つかどうかを判断します。

GetHashCode()

オブジェクトのハッシュ コードを VoiceInfo 提供します。

GetType()

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

(継承元 Object)
MemberwiseClone()

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

(継承元 Object)
ToString()

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

(継承元 Object)

適用対象

こちらもご覧ください