15#ifdef ENABLE_NI_SPEECH
24#pragma comment(lib, "sapi.lib")
27#define NI_SPEECH_LANG_US "Language=409"
28#define NI_SPEECH_LANG_JP "Language=411"
30#define NI_SPEECH_LANG_US_KINECT "Language=409;Kinect=True"
31#define NI_SPEECH_LANG_JP_KINECT "Language=411;Kinect=True"
44 CNiSpeech(IStream* stream=NULL, WAVEFORMATEX* format=NULL);
45 virtual ~CNiSpeech(
void) {}
50 BOOL init(IStream* stream, WAVEFORMATEX* format);
51 BOOL create(LPCTSTR lang);
52 BOOL load(LPCTSTR file);
55 BOOL start(
double confidence);
58 void setConfidence(
double confd);
61 static UINT speechThread(LPVOID pParam);
62 UINT speechThread(
void);
66 virtual void map2action(LPCTSTR tag,
double confd);
69 ISpStream* m_pSpeechStream;
70 ISpRecognizer* m_pSpeechRecognizer;
71 ISpRecoContext* m_pSpeechContext;
72 ISpRecoGrammar* m_pSpeechGrammar;
74 HANDLE m_hSpeechEvent;
77 CWinThread* m_speechThread;