Window Store 应用程序中的文本到语音 [英] Text to Speech in Window Store App
本文介绍了Window Store 应用程序中的文本到语音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的应用程序中,我使用 SpeechSynthesizer 使用 Text 2 Speech.在我的代码中,它只用 3 个声音说话(一个男性和两个女性).我的应用程序是为孩子们准备的,所以我想要像孩子一样的声音我怎么能做到这一点?
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?
代码:
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);
}
推荐答案
您可以使用 StartVoice(VoiceGender sex, VoiceAge age)
简单示例:
PromptBuilder pb = new PromptBuilder();
pb.StartVoice(VoiceGender.Male, VoiceAge.Child);
pb.AppendText("I like my toy car");
pb.EndVoice();
您可能想搜索支持您所需图片的 TTS.
You might want to search for TTS's that support your desired picth.
这是所有可用语言的链接:语言一个>
Here is the link for all languages available: Languages
干杯
这篇关于Window Store 应用程序中的文本到语音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文