SpeechSynthesizer doesn't get all installed voices - c#

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<string> 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.

Related

How do I programmatically determine if and where Mono 64 bit is installed in Windows?

I found these registry settings
Assuming the user installed the Mono 64 bit MSI, can I in C# code read the registry and rely on
1 + 2 indicating that Mono 64 bit is installed
3 where the Mono lib folder is
4 where Mono config folder is and
5 where the mono-2.0-sgen.dll is located.
I am asking because
I did not find this documented on the Mono website (e.g. Mono FAQ: Technical, Install Mono on Windows, Mono Runtime Documentation, Mono Runtime Documentation)
Perhaps there is a better / alternative approach. (e.g. the GAC ... I'm not keen on the GAC but perhaps ...)
(I assume that anything under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node would be 32 bit and would not indicate 64bit mono.)
Update I've asked on Mono-Github and here's their answer: https://github.com/mono/mono/issues/10535
.NET provides a series of classes for reading registry entry
Here is an example of how to do that. Another example is here
In your case, the key location is number 1 from picture posted, the key is "Architecture" and it's "x64" and so on
Try that code from the above link and see if works. Some adaptation needs to be done.
If you get an error regarding administrative rights try to run Visual Studio as administrator.

SpeechRecognitionEngine recognizers

I just downloaded the fr-FR runtime language pack so that I can recognize French speech through my program.
However, my program throws the error
Additional information: No recognizer of the required ID found.
at
SpeechRecognitionEngine recognizer =
new SpeechRecognitionEngine(new System.Globalization.CultureInfo("fr-FR"));
en-US and en-GB works because they are pre-installed with my system, I just installed these new language packs but they are still throwing this exception.
Also, if this helps, when I do
foreach (var x in SpeechRecognitionEngine.InstalledRecognizers())
{
Console.Out.WriteLine(x.Name);
}
it prints
MS-1033-80-DESK
EDIT: This is not a possible duplicate because this isn't about having no recognizers installed, it's about C# SAPI not seeing that I have the installed pack for the current language
I was able to get this to work... there is an extra step involved.
Since you're using System.Speech, it uses the installed Desktop speech recognition that comes with Windows. The error you're getting is not because you don't have the language installed, but because you didn't install the speech recognizer for that language.
So, head on over to Setting > Time and Language > Region and language (which is probably where you installed the language from). After you install the language, select the language, and click 'Options'. You should see options to download the language pack, spell checking, and the one we're interested in, Speech. Click Download, and wait for the download/install to finish.
Once it's done, you won't get a notification, but you can go into Settings > Time and Language > Speech and see your installed recognizers there, or you can go to Settings > Speech Recognition > Advanced Speech Options to see the same list.
Now when you run your program, it should work. BTW, if you want to see the installed speech recognizers in your code, use this instead:
foreach (var x in SpeechRecognitionEngine.InstalledRecognizers())
{
Console.WriteLine(x.Culture.Name);
}
You only get a code when asking for the recognizers name, you want the culture's name. (as you saw, MS-1033-80-DESK corresponds to en-US. For reference, fr-FR is MS-1036-80-DESK).
Is it possible that you installed the Microsoft Speech Platform French language pack? Such as the ones seen here? MS Speech Platform Language Packs
If that's the case then it won't appear as an installed language for what you're doing. To get it to work, from what I understand, you will need a language pack installed for French instead which is only available for Windows Ultimate and Enterprise editions if you're using a non-French version of windows.
If that's impossible, then you might have to figure out how to use the Microsoft Speech Platform SDK vs Windows/SAPI. Right now it seems like you're trying to use Windows/SAPI with a Speech Platform Recognizer. Here's the MS page the shows the difference between the MS Speech Platform vs. Windows/SAPI

how to make an executable version of a WPF Kinect Application?

I have made a Kinect Application in Microsoft Visual Studio 2010. I need to make an exe of the application which can run on any windows based system. If I need to do that than is there any requirements that the system should fulfil? and If yes, then how do I do that?
I tried to use the exe in application/bin/debug/application.exe by copying it in another folder but it shows an error but if I run the exe from the bin/debug/application.exe it works. Am I missing something here or is it the only way to do that?
"Any Windows based system" isn't going to work. Assuming you're using the Kinect SDK, it will only run on Windows 7 (and supposedly Windows Server 2008). The computer running the application will need either the Kinect Runtime, which only works with the new Kinect for Windows sensor, or the Kinect SDK, which also works with the Kinect for Xbox. Microsoft wants to sell more Kinect for Windows sensors, so they don't allow the runtime to work with the old Xbox Kinects. Makes sense in a way, but man that bugged me when I first found out about it. There's a short post showing how to test for the existence of the Runtime on application load, so you can show an appropriate error message instead of just crashing out.
You need to copy any files that the program relies on, such as DLL files, along with the executable. There's instructions here for how to embed the DLL files into the executable; I've not tried it but it might be worth a shot.
The correct .NET version should be installed when either the Runtime or the SDK is installed; you shouldn't have to worry about this.
#Coeeffect is right, but you can also publish version 1.0.0.0 of your app by going to project -> properties -> publish -> publishing wizard to publish your application to then use on ther computes ect. Hope this helps!
You need to copy all non-standard DLLs that your program uses.
The target computer needs the appropriate version of .Net.

How to run the C# SkeletalViewer sample provided in the Kinect SDK?

Just downloaded the new Kinect SDK Beta from Microsoft and am really excited to start working. Only problem, I can't figure out how to run the provided SkeletalViewer sample program (the packaged executable runs fine but not the source code). Whenever I try to run it I get a FileNotFoundException for "INuiInstanceHelper.dll" at
nui = new Runtime(); //Line 78 in MainWindow.xaml.cs
Any ideas on how to fix it?
Update:
Looks like it works now... I did not do much beyond updating Windows and maybe more importantly installing the DirectX Client (thought I already had it).
I had the same problem.
The things you need to take into account for the camera are:
Install the Kinect SDK from Microsoft.
Connect the Kinect sensor to a full powered USB (preferably, one on the back).
Reboot your system at least one time after everything was installed. (My problem was originally fixed with this step)
And for the speech recognition:
If you are using a x64 bits version of Windows, when you install the speech prerequisites (they are listed on the readme), ensure to install the 32 bit version of the Speech library even when you OS is x64.

IACore.dll, IAWinFX.dll, IALoader missing

I have installed the Microsoft Windows SDK for Windows 7 and .NET Framework 4 through this link ( http://www.microsoft.com/downloads/dlx/en-us/listdetailsview.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b ) on a Windows 7 machine and trying to following the instructions about how to create a Handwriting Recognition WPF application using this guide ( http://msdn.microsoft.com/en-us/library/ms754080%28VS.90%29.aspx ).
However, I couldn't find the IACore.dll, IAWinFX.dll and IALoader.dll mentioned inside the guide. I have even done a search in my Windows installation drive just in case they are installed in another location. But it just seems that the files are not even installed anywhere.
Or is there any alternative for me to build a WPF Handwriting Recognition application?
I found it in:
c:\Program Files\Reference Assemblies\Microsoft\Tablet PC\v1.7\

Categories

Resources