You may need to add a Speech Language to Windows 10 and set your Locale, Country, Windows display language and Speech language so they are all aligned with one of Cortana's supported locale configurations.
To confirm the settings are set correctly:
Open Settings. Select Time& language, and then Region & Language.
Check the Language (set as default) setting for your Windows display language. If your desired language is not available, add your desired language:
- Click Add Language.
- Select your desired language from the list.
- Select the desired locale, which is the language/country combination.
- Click on the newly selected locale and select Options.
- Under Download language pack, click Download.
- Under Speech, click Download.
- After the downloads are complete (this could take several minutes), return to the Time & Language settings.
- Click on your new language and select Set as Default.
- NOTE: IF you changed languages, you must sign out of your account and back in for the new setting to take effect.
Check the Country or region setting. Make sure the country selected corresponds with the Windows display language set in the Language setting.
Return to Settings and Time & language, and then select Speech. Check the Speech language setting, and make sure it’s aligned with the previous settings.
After you have correctly done the above, your language should appear in the SpeechSynthesizer.AllVoices collection. You should then be able to assign this voice to your SpeechSynthesizer instance's Voice property:
private async void SpeakText(MediaElement audioPlayer, string TTS)
{
SpeechSynthesizer ttssynthesizer = new SpeechSynthesizer();
//Set the Voice/Speaker to Spanish
using (var speaker = new SpeechSynthesizer())
{
speaker.Voice = (SpeechSynthesizer.AllVoices.First(x => x.Gender == VoiceGender.Female && x.Language.Contains("ES")) );
ttssynthesizer.Voice = speaker.Voice;
}
SpeechSynthesisStream ttsStream = await ttssynthesizer.SynthesizeTextToStreamAsync(TTS);
audioPlayer.SetSource(ttsStream, "");
}
http://answers.microsoft.com/en-us/windows/forum/windows_10-other_settings/speech-language-in-windows-10-home/3f04bc02-9953-40b1-951c-c1d262fc3f63?auth=1
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…