InstalledVoice 클래스

정의

Windows에 설치된 음성 합성 음성에 대한 정보를 포함합니다.

public ref class InstalledVoice
public class InstalledVoice
type InstalledVoice = class
Public Class InstalledVoice
상속
InstalledVoice

예제

다음 예제는 초기화 하는 콘솔 애플리케이션의 일부를 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();  
    }  
  }  
}  

설명

이 클래스를 사용 하 여 해당 문화권, 이름, 성별, 연령과 포함 하 여 설치 된 음성에 대 한 정보를 사용할 수 있는지 여부 및 합니다.

지정 된 언어를 사용 하 여 텍스트 음성 변환 하는 데는 Culture 속성, 음성 합성 엔진이 지 원하는 언어-국가 코드를 설치 해야 합니다. Microsoft Windows 7과 함께 제공 되는 음성 합성 엔진은 다음 언어-국가 코드를 사용 하 여 작동 합니다.

  • EN-US입니다. 영어(미국)

  • zh-CN. 중국어(중국)

  • zh-TW. 중국어(대만)

"En"와 같은 두 문자 언어 코드도 허용 됩니다.

속성

Enabled

음성을 사용하여 음성을 생성할 수 있는지 여부를 가져오거나 설정합니다.

VoiceInfo

문화권, 이름, 성별, 연령 등, 음성에 대한 정보를 가져옵니다.

메서드

Equals(Object)

지정된 개체가 InstalledVoice 의 인스턴스이고 InstalledVoice의 현재 인스턴스와 같은지 여부를 확인합니다.

GetHashCode()

InstalledVoice 개체에 대한 해시 코드를 제공합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상