SpeechSynthesizer doesn't get all installed voices
I have installed a new 32 bits Scansoft voice (Jennifer) in my Windows 7 64 bits OS in order to be able to use from in one .NET application i'm developing.
The problem is that I when I call the method :
List<s开发者_运维知识库tring> allInstalledVoices = new SpeechSynthesizer().GetInstalledVoices();
I only get one voice returned, the default Microsoft Anna Voice. but I can see all the installed voices in other text to speech application.
I found what the problem was. It turns out that when compiling the project to "Any CPU" (using Visual Studio 2008), the problem occurs. but when changed to x86, the problem doesn't appear anymore.
I'm having troubles verifying this, but I believe that Scansoft's Jennifer voice is a SAPI 4.0 compliant voice; the Managed Speech API only works with SAPI 5.1 compliant voices.
A recent update to Windows means the posted answer to this problem no longer works.
The new fix is:
The Speech files that are listed in the Registry Location...
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens\(filename)]
... all need to be copied to a new location:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\(filename)]
Note that the "Attributes" sub folder ie [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens\(filename)\Attributes]
also need to be copied to the new location, and edited so that it correctly reflects the name and path of the speech file it refers to.
精彩评论