Kosmo零
Kosmo零

Reputation: 4151

How to get and use full installed text-to-speech languages list?

There is something really weird happening in Windows 10 speech synthesis.

First of all, even Windows displays different installed languages count in metro and classic control panels.

Metro app shows 5 installed languages, while classic control panel shows only 3.

I need to use Microsoft Pavel language, but my app simply don't see it!

SpeechSynthesizer ss = new SpeechSynthesizer();
var installed_voices = ss.GetInstalledVoices();

for (int i = 0; i < installed_voices.Count; i++)
    Console.WriteLine(GetVoiceInfoDesc(installed_voices[i].VoiceInfo));

static string GetVoiceInfoDesc(VoiceInfo vi)
{
    return vi.AdditionalInfo["Name"] + " (ID = " + vi.AdditionalInfo["Language"] + ", " + vi.AdditionalInfo["Age"] + ", " + vi.AdditionalInfo["Gender"] + ", " + vi.Culture + ")";
}

The code above displays only 3 installed languages.

Also, when I use

ss.SelectVoiceByHints(VoiceGender.Male, VoiceAge.Adult, 0, CultureInfo.CreateSpecificCulture("ru-RU"));

I still get Irina voice that is female.

I tested Pavel's voice and it's really installed and speaks something.

I use .net 4.0 C#. Any ideas what's happening here?

enter image description here

Upvotes: 0

Views: 1082

Answers (2)

Tagor
Tagor

Reputation: 1026

I had the same problem and tried multiple solutions but none of them worked. My requirement was not to have the specific voices found in windows 10 so i looked for other resources and found this.

I have tried installing some of them and my application recognizes them as being installed and they work as expected. Maybe you can find some voices there that suits your needs. Good luck!

Upvotes: 1

Kosmo零
Kosmo零

Reputation: 4151

The problem that is some languages for some unknown reason can be used in metro apps only and can't be seen through SAPI.

We can fix this by changing registry.

This is fix example for Windows 10 x64 Pavel's voice that I took from somewhere in Internet:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Speech\Voices\Tokens\MSTTS_V110_ruRU_PavelM]
@="Microsoft Pavel Mobile - Russian (Russia)"
"419"="Microsoft Pavel Mobile - Russian (Russia)"
"CLSID"="{179F3D56-1B0B-42B2-A962-59B7EF59FE1B}"
"LangDataPath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,\
  00,70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,\
  65,00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,\
  00,5c,00,72,00,75,00,2d,00,52,00,55,00,5c,00,4d,00,53,00,54,00,54,00,53,00,\
  4c,00,6f,00,63,00,72,00,75,00,52,00,55,00,2e,00,64,00,61,00,74,00,00,00
"VoicePath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,00,\
  70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,65,\
  00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,00,\
  5c,00,72,00,75,00,2d,00,52,00,55,00,5c,00,4d,00,31,00,30,00,34,00,39,00,50,\
  00,61,00,76,00,65,00,6c,00,00,00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Speech\Voices\Tokens\MSTTS_V110_ruRU_PavelM\Attributes]
"Age"="Adult"
"DataVersion"="11.0.2013.1022"
"Gender"="Male"
"Language"="419"
"Name"="Microsoft Pavel Mobile"
"SharedPronunciation"=""
"Vendor"="Microsoft"
"Version"="11.0"

Readme says "Thanks to Nonna Lavrukhina".

Upvotes: 2

Related Questions