Microsoft Speech Recognition - what reference do I have to add?
Asked Answered
L

4

10

I'm trying to make a C# program that uses the Microsoft Speech Recognition API (with Kinect) but I'm struggling to get started. I have the using statements

using Microsoft.Speech.AudioFormat;
using Microsoft.Speech.Recognition;

But it's giving me the error "the type or namespace name 'Speech' does not exist in the namespace 'Microsoft'. Are you missing an assembly reference?"

Does anyone know what to add? System.Speech doesn't do the trick.

Lenticel answered 3/4, 2012 at 22:52 Comment(2)
Did you add the reference to the Microsoft Speech Recognition API DLL or Project to your project?Whimsicality
See SpeechTurtle.codeplex.com for a project that works both with and without Kinect and Microsoft.Speech for driving a turtle using your voice (based on a Kinect SDK sample). Current version is for 1.8 SDK (Kinect for Xbox 360 and Kinect for Windows v1), plan to update it to work with 2.0 SDK too (via MEF plugin) in the future (to also support KfW v2 and Kinect for Xbox One) when I get the newer Kinect for Xbox One and the adapter for WindowsStalactite
T
23

Make sure you add this assembly to your project: C:\Program Files\Microsoft SDKs\Speech\v11.0\Assembly\Microsoft.Speech.dll.

More details can be found on MSDN

Trebizond answered 3/4, 2012 at 23:3 Comment(0)
C
9

I think there is some confusion because you are using the Kinect SDK and some of the answers here regard the related SDKs (System.Speech in .net and Microsoft.Speech that is distributed with a variety of Microsoft server products and the Server Speech Platform). From your comments in the other answers it seems that Kinect SDK uses the Microsoft.Speech namespace and your app must reference the Microsoft.Speech.dll that came with the Kinect SDK.

Just to help clarify a few things (I hope):

System.Speech is a core .net API and a recognizer that implements it is included in Windows 7. It is a client or desktop recognizer and can be trained for specific users and includes a dictation grammar.

Microsoft.Speech is a .net API that is similar, but a bit different. Recognizers that implment Microsoft.Speech are part of various Server products like UCMA and the Microsoft Server Speech Platform.

As you point out, Microsoft.Speech is also the API used for the Kinect recognizer. This is documented in the MSDN link Philipp Schmid mentioned in a comment Speech C# How To (Kinect). I have not worked with Kinect, but this makes sense since the recognizer doesn't require speaker training.

These resources are a bit out date, because the predate Kinect, but they may be helpful:

Microsoft.Speech and System.Speech are similar, but different. See What is the difference between System.Speech.Recognition and Microsoft.Speech.Recognition?

To get started with .NET speech, there is a very good article that was published a few years ago at http://msdn.microsoft.com/en-us/magazine/cc163663.aspx. It is probably the best introductory article I’ve found so far. It is a little out of date, but very helfpul. (The AppendResultKeyValue method was dropped after the beta.) This article shows the System.Speech namespace, but most of that can be directly mapped to Microsoft.Speech.

Capitalism answered 4/4, 2012 at 1:0 Comment(0)
U
7

You need to do this, which works for me.

Import Microsoft.Speech.dll from the following location:

C:\Windows\assembly\GAC_MSIL\Microsoft.Speech\11.0.0.0__31bf3856ad364e35\Microsoft.Speech.dll
Unbroken answered 4/9, 2013 at 13:29 Comment(0)
C
1

Try the System.Speech.Recognition namespace instead. The Microsoft.Speech.Recognition namespace is part of the Office Communications Server product.

Help link: System.Speech.Recognition

Office Communications Server (UCMA Application)UCMA Speech SDK

Coralyn answered 3/4, 2012 at 23:3 Comment(6)
I'm roughly following this guide. Is that out of date? I thought that Microsoft.Speech and System.Speech were separate?Lenticel
Microsoft.Speech and System.Speech are similar, but different. See #2977838Capitalism
Wow. Cool. That's really clarifying.Coralyn
Thanks, but see my new answer. My comment above didn't help explain Kinect.Capitalism
this doesnt work for me. i am using visual studio express 2013. i am not able to get microsoft.speech and am not able to find microsoft.speech.dll fileAndes
System.Speech.Recognition is part of .Net 4+. Are you familiar with .Net and how to find assemblies?Coralyn

© 2022 - 2024 — McMap. All rights reserved.