Kinect and Speech Recognition in Visual Studio 2010

Hi everybody,

I am trying to get the Microsoft Speech Platform integrated into oF, capturing sound coming from the Kinect.
I can get everything working outside oF in C++ (Kinect + Microsoft Speech) but I can’t compile in oF.

When trying to compile I get this error:
This file requires _WIN32_WINNT to be #defined at least to 0x0403. Value 0x0501 or higher is recommended.

So I changed this value in ofConstants.h like so:
# define _WIN32_WINNT 0x400 into # define _WIN32_WINNT 0x403

but then I get this errors like this which I am unable to solve:
‘CreateFile’ : is not a member of ‘global namespace'' 'GetModuleFileName' : is not a member of 'global namespace’’

If anybody knows what to do about this, that would be great!

Thanks in advance!

I’ve found a solution for compiling oF+ofxKinectNui+Microsoft Speech SDK v11+Kinect SDK 1.6

It’s not a real solution but it’s more kind a like a dirty hack.

btw, I am following a four days course given by Arturo and Jesus at this moment, so that’s great :slight_smile:

I am on Windows 8, using Visual Studio 2010 and oF .072.

First of all it is important to target the 32bit version of the Speech Platform v11.
This is not the same one as the Speech SDK 5.1. You can not get the Kinect audio working with the 5.1 version of the speech sdk. You need to target thet 32 bit version of the Speech Platform v11.

For the speech recognition to work you need to import 2 headers.
#include <sapi.h>
#include <sphelper.h>

If you import these headers after the #include “ofMain.h” you will be in compiler hell for days…

So just import these headers in your main.cpp before everything else:

#include <sapi.h>  
#include <sphelper.h>  
#include "ofMain.h"  
#include "testApp.h"  
#include "ofAppGlutWindow.h"  
int main( )....  

Then in your testApp.h import them again to use them.

#pragma once  
#include <sapi.h>  
#include <sphelper.h>  
#include "ofxKinectNui.h"  
#include "ofMain.h"  
class testApp : public ofBaseApp{...  

This is a bit dirty and it will output extra warnings, but at least it compiles…