Share via


VoiceInformation.Gender Proprietà

Definizione

Ottiene l'impostazione di genere del motore di sintesi vocale (voce).

public:
 property VoiceGender Gender { VoiceGender get(); };
VoiceGender Gender();
public VoiceGender Gender { get; }
var voiceGender = voiceInformation.gender;
Public ReadOnly Property Gender As VoiceGender

Valore della proprietà

Sesso della voce.

Esempio

In questo caso viene illustrato come selezionare un sesso per la voce (VoiceInformation.Gender) usando la prima voce femminile (VoiceGender) trovata o semplicemente la voce di sistema predefinita (SpeechSynthesizer.DefaultVoice), se non viene trovata alcuna voce femminile.

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

Commenti

Ecco un elenco di voci firmate da Microsoft fornite con Windows.

Chiamata vocaleSessoWindows 8Windows 8.1NomeNome visualizzato
Inglese (Stati Uniti)FemaleSSZiraMicrosoft Zira (en-US, femminile).
Inglese (Stati Uniti)MaleSSDavidMicrosoft David (en-US, maschio)
GB ingleseFemaleSSNocciolaMicrosoft Hazel (en-GB, femminile)
Francese FRFemaleSSHortenseMicrosoft Hortense (fr-FR , femmina)
DE tedescoFemaleSSHeddaMicrosoft Hedda (de-DE, femmina)
Spagnolo ESFemaleSSHelenaMicrosoft Helena (es-ES, femminile)
PrC cineseFemaleSSHuihuiMicrosoft Huihui (zh-CN, femmina)
TW cineseFemaleSSHanhanMicrosoft Hanhan (zh-TW, femminile)
Ja giapponeseFemaleSSHarukaMicrosoft Haruka (ja-JP, femminile)
KR coreanoFemaleSSHeamiMicrosoft Heami (ko-KR, femminile)
MX spagnoloFemaleNSSabinaMicrosoft Sabina (es-MX, femminile)
IT italianoFemaleNSElsaMicrosoft Elsa (it-IT, femmina)
Inglese INFemaleNSHeeraMicrosoft Heera (en-IN, femminile)
UR russoFemaleNSIrinaMicrosoft Irina (ru-UR, femmina)
Cinese HKFemaleNSTracyMicrosoft Tracy (zh-HK, femmina)
Pl polaccoFemaleNSPaulinaMicrosoft Paulina (pl-PL, femmina)
Portoghese BRFemaleNSMariaMicrosoft Maria (pt-BR, femmina)

Si applica a

Vedi anche