0

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);
            }
user3090763
  • 1,089
  • 1
  • 10
  • 24
  • 1
    What do you mean 'Voice just like the kids'? Do you mean higher-pitched? – Nate Diamond Mar 26 '14 at 19:04
  • I mean like kids voice not adults. – user3090763 Mar 26 '14 at 19:31
  • You'll probably have to do this with something like [`SharpDX`](http://sharpdx.org/documentation/api/t-sharpdx-xaudio2-sourcevoice). This provides some Direct-X based audio processing, specifically with XAudio2. You'll have to load in the audio stream as a Voice into it, then use something like [`SetFrequencyRatio`](http://sharpdx.org/documentation/api/m-sharpdx-xaudio2-sourcevoice-setfrequencyratio) to bump the frequency up a bit. Good luck! – Nate Diamond Mar 26 '14 at 20:17

1 Answers1

0

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

tweellt
  • 2,171
  • 20
  • 28