问题
In my application I am using Text 2 Speech using SpeechSynthesizer.In my code it is speaking with only 3 voices ( One male and two females).My application is for kids so i want voice just like kids how can i achieve that?
CODE:
var synth = new SpeechSynthesizer();
foreach (var voice in SpeechSynthesizer.AllVoices)
{
synth.Voice = voice;
var text = "Hello World";
var stream = await synth.SynthesizeTextToStreamAsync(text);
var me = new MediaElement();
me.SetSource(stream, stream.ContentType);
me.Play();
await Task.Delay(3000);
}
回答1:
You can change the Gender and age using StartVoice(VoiceGender gender, VoiceAge age)
Simple Example:
PromptBuilder pb = new PromptBuilder();
pb.StartVoice(VoiceGender.Male, VoiceAge.Child);
pb.AppendText("I like my toy car");
pb.EndVoice();
You might want to search for TTS's that support your desired picth.
Here is the link for all languages available: Languages
Cheers
来源:https://stackoverflow.com/questions/22670729/text-to-speech-in-window-store-app