VoiceGender 열거형

정의

음성 합성에 사용할 수 있는 성별 기본 설정을 지정합니다(지정된 음성 합성 엔진에서 지원하는 경우).

public enum class VoiceGender
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
enum class VoiceGender
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public enum VoiceGender
var value = Windows.Media.SpeechSynthesis.VoiceGender.male
Public Enum VoiceGender
상속
VoiceGender
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

필드

Female 1

Female

Male 0

Male

예제

여기서는 첫 번째 여성 음성(VoiceGender)을 사용하여 음성(VoiceInformation.Gender)의 성별을 선택하거나, 여성 음성이 없는 경우 기본 시스템 음성(SpeechSynthesizer.DefaultVoice)만 사용하는 방법을 보여 줍니다.

using (SpeechSynthesizer synthesizer = new SpeechSynthesizer())
{
    VoiceInformation voiceInfo =
        (
            from voice in SpeechSynthesizer.AllVoices
            where voice.Gender == VoiceGender.Female
            select voice
        ).FirstOrDefault() ?? SpeechSynthesizer.DefaultVoice;

    synthesizer.Voice = voiceInfo;

    // Windows.Media.SpeechSynthesis.SpeechSynthesisStream
    stream = await synthesizer.SynthesizeTextToStreamAsync(text);
}

적용 대상

추가 정보