SAPI 5 voice synthesis and C#
Asked Answered
C

1

4

I have installed new SAPI5 voice. In computer settings of Speech program is new voice visible and available to use. But my program cannot find it. To find it, I am using this part of code, I use System.Speech.Synthesis namespace.

SpeechSynthesizer s = new SpeechSynthesizer();
foreach (InstalledVoice v in s.GetInstalledVoices())
{
    st += v.VoiceInfo.Name+"\n";
}

MessageBox.Show(st);

The only voice found is Microsoft Anna. My code for speeking is as follow:

s.SelectVoice("Eliska22k");//name of the voice is Eliska22k

s.Speak("ahoj");

I am using C# 4 and I have windows vista 32 bit. Where is my mistake? Is in the code or anywhere else?

EDIT: requested registry values:

in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices

DefaultTokenId: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\TokenEnums\Infovox Desktop v2.2\Eliska22k

DefaultTTSRate: 0

in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\TokenEnums\Infovox Desktop v2.2\Eliska22k

405: Eliska (Czech) SAPI5

CLSID: {F8E89351-F6B9-4C98-91F9-A967BA752655}

VoiceData: Eliska22k

in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\TokenEnums\Infovox Desktop v2.2\Eliska22k\Attributes

Age: Adult

AudioFormats 18

Gender: Female

Language: 405;5

Name: Eliska22k

Church answered 16/7, 2012 at 9:21 Comment(6)
Document the content of the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices registry key.Thornhill
Use SpeechSynthesizer.GetInstalledVoices() to make sure it finds the voice, and the name matches to the one you try to select.Favourite
I am already try this with GetInstalledVoices(), voice is not foud, @HansPassant what kind of information do you nedd?Paredes
@HansPassant I have added registry informationParedes
@Church I'm interested in czech voice speech. Can I ask you there you found this voice and if is it working correctly with .NET speech? Thanks.Becoming
How can I install more voices, I only have Microsoft Anna.Ricker
R
0

You can try to change the target platform and Framework version of your .NET project. Some voices are supported only for x86.

Rincon answered 16/7, 2015 at 15:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.