Text to Speech in Window Store App

 ̄綄美尐妖づ 提交于 2019-12-25 02:03:52

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!