Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use all voices available?

I am using this command to list available voices

private static SpeechSynthesizer sprecher;

...

sprecher = new SpeechSynthesizer();

...

private static List<VoiceInfo> GetInstalledVoices()
{
    var listOfVoiceInfo = from voice
                          in sprecher.GetInstalledVoices()
                          select voice.VoiceInfo;

    return listOfVoiceInfo.ToList<VoiceInfo>();
}

I get only 4 different voices (Hedda, Hazel, David and Zira) yet windows itself shows many more speakers.

enter image description here

Therefore I only get the "-Desktop"-voices. How do I access the other speakers via c#?

like image 255
Vitalis Hommel Avatar asked Apr 02 '18 16:04

Vitalis Hommel


People also ask

How do I add more voices?

Under Narrator's voice, select Add legacy voices. This will take you to the Speech settings page. Under Manage voices, select Add voices. Select the language you would like to install voices for and select Add.

How do you change the narrator voice?

Personalize Narrator's Voice in Windows 10 You can change the Narrator's voice a number of different ways. From the Narrator settings screen, use the drop-down menu to choose which voice you want to use for Narrator. Change the speed, pitch, and volume of your chosen voice through the sliders on the settings screen.


1 Answers

Edit 2: OP got it to work by using export instead of command line copying

Export the whole Token Directory of Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices to a file. Replace every HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens with HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens in the file and run the file(I removed the voices I already had before).

On the following thread a MSDN user, A.Kelany, asks a similar question, where he is only getting two voices from the GetInstalledVoices method.

He said he was able to fix this by doing the following :

I managed to get it to work in a test project by doing the following : I opened the registry and noticed that there is a node : Quote: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices

which contained the voices that appear in the application GetInstalledVoices method

and there is another node :

Quote: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices

that contained all the voices including the ones don't appear in the aforementioned method,

So I copied one of the voices from the second node to the first node and it worked!

He also states that he could not build on Any CPU after this change, and had to change the build type to x64

like image 140
hellyale Avatar answered Sep 29 '22 15:09

hellyale