views:

130

answers:

2

Hello. SpeechSynthesizer allows peaking different voices by using SelectVoiceByHints(VoiceGender, VoiceAge)function (as I understood). But no customization happens if I change the gender and voice age.

Can you explain why? And if I'm doing something wrong, what is correct way to do that?

Thank you.

A: 

According to the name of the function, I'd say this is a selector for installed voices. It does not customize the voice in any way, but rather picks one from the repo according to your specified parameters.

So, if there is only one voice installed, he can only pick that one.

Bobby
Yep, maybe, but I couldn't really find any explanation how to extend the list of the voices :).
LexRema
You can buy third-party voices, some of which are really quite good. I don't have a link off-hand though.
chaiguy
Maybe, but I don't really understand how is it working in general. How framework gets the info about installed voices?
LexRema
When you install a voice, the installer places information in the registry about the age, gender, etc. of the voice. The framework reads the registry to find the data of the voice. (In C++, the interface you're looking for is ISpObjectToken, and the MS implementation uses the registry. Other TTS engines would have their own implementation of ISpObjectToken, and might not use the registry.)
Eric Brown
+2  A: 

Here's a small test program that you can use to discover installed voices:

using System;
using System.Speech.Synthesis;  // Add reference to System.Speech

class Program {
    static void Main(string[] args) {
        var synth = new SpeechSynthesizer();
        foreach (var voice in synth.GetInstalledVoices()) {
            Console.WriteLine(voice.VoiceInfo.Description);
        }
        Console.ReadLine();
    }
}

Output on my machine: Microsoft Anna - English (United States)

Which is the one and only default voice that's shipped with Windows afaik. Which would of course explain why changing gender and age doesn't have an effect on your machine.

Hans Passant