- Home /
Problem with referencing namespaces C#
I want to use Speech Recognition in my Unity 4.6 game. I found that in C# you can use the Windows default speech recognition engine by referencing System.Speech. I tested this in a separate project and it worked easily. However, now I want to do the same in Unity but there is a problem.
I use this method to reference the System.Speech namespace. In Monodevelop, this appears to work fine. But then in Unity Editor, it doesn't agree and gives me a set of errors.
Unity Editor doesn't know the namespace System.Speech for some reason. And there is my problem. I tried referencing the namespace in all other assemblies, but it didn't fix it.
What am I doing wrong?
Answer by Baste · Sep 14, 2015 at 11:03 AM
System.Speech was introduced in .NET 4. Unity's stuck on the old .NET 2.
You can still use the speech things - write some wrappers for them in a "normal" C# project, and then compile that to a .dll that you use in your Unity project.
Be aware that System.Speech might not work out of the box on every platform even if you do that. It should work on Windows, but I'm guessing that you'll be out of luck on a Playstation or Iphone.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
save and load scene 1 Answer
How do i make that the character head to rotate to where the mouse cursor is ? 0 Answers
Running animation not working and jumping isn't working. 0 Answers