00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OpenSpace3D 00004 For the latest info, see http://www.openspace3d.com 00005 00006 Copyright (c) 2010 I-maginer 00007 00008 This program is free software; you can redistribute it and/or modify it under 00009 the terms of the GNU Lesser General Public License as published by the Free Software 00010 Foundation; either version 2 of the License, or (at your option) any later 00011 version. 00012 00013 This program is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00015 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License along with 00018 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00019 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00020 http://www.gnu.org/copyleft/lesser.txt 00021 00022 You may alternatively use this source under the terms of a specific version of 00023 the OpenSpace3D Unrestricted License provided you have obtained such a license from 00024 I-maginer. 00025 ----------------------------------------------------------------------------- 00026 */ 00027 00028 00037 #ifndef __RECO_H__ 00038 #define __RECO_H__ 00039 00040 00042 #define GID_DICTATION 0 00043 #define GRAM_ID 0 00044 00045 00046 class Recognition 00047 { 00048 00049 public: 00050 00051 Recognition(); 00052 ~Recognition(); 00053 void close(); 00054 bool initializeObjects(); 00055 void callbackEventReco(); 00056 char* getTextReco(); 00057 int getVolumeReco(); 00058 void setvolumeReco(ULONG volumeReco); 00059 HRESULT CreateRecoCtxt(LRESULT ItemData); 00060 static void _stdcall sapi_callback(WPARAM wParam, LPARAM lParam); 00061 void createGrammar1(); 00062 void addWord(char *s_Rule, char *s_Word); 00063 00064 private: 00065 char* TextReco; 00066 BOOL m_bInSound; 00067 BOOL m_bGotReco; 00068 LANGID m_langid; 00069 HFONT m_hfont; 00070 ISpAudio * cpAudio; 00071 00072 CComPtr<ISpRecognizer> pRecog; 00073 CComPtr<ISpRecoContext> cpRecoContext; 00074 CComPtr<ISpRecoGrammar> cpRecoGrammar; 00075 CComPtr<ISpPhoneConverter> m_cpPhoneConv; 00076 }; 00077 00078 #endif
1.6.3