Template
reco.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25
34#ifndef __RECO_H__
35#define __RECO_H__
36
38#include <sapi.h>
39#include <sphelper.h>
40#include <spuihelp.h>
41#include <mlang.h>
42
44#define GID_DICTATION 0
45#define GRAM_ID 0
46
50{
51public:
52protected:
53private:
54 BOOL m_bInSound;
55 BOOL m_bGotReco;
56 LANGID m_langid;
57 HFONT m_hfont;
58 ISpAudio* cpAudio;
59 CComPtr<ISpRecognizer> pRecog;
60 CComPtr<ISpRecoContext> cpRecoContext;
61 CComPtr<ISpRecoGrammar> cpRecoGrammar;
62 CComPtr<ISpPhoneConverter> m_cpPhoneConv;
63
64public:
68
71 Recognition(std::string pathtobin, std::string lang);
72
76
79 bool initializeObjects();
80
83 void callbackEventReco();
84
87 int getVolume();
88
91 void setVolume(int volume);
92
95 static void _stdcall sapi_callback(WPARAM wParam, LPARAM lParam);
96
99 void AddWord(std::string s_Rule, std::string s_Word);
100protected:
101private:
102};
103
104#endif
Management of the recognition class .
Definition reco.h:50
void setVolume(int volume)
Set The volume for the recognition.
Definition reco.cpp:340
void callbackEventReco()
Recognition Event Callback.
Definition reco.cpp:233
void AddWord(std::string s_Rule, std::string s_Word)
Add word to recognition.
Definition reco.cpp:66
Recognition()
utils libraries
Definition reco.cpp:37
bool initializeObjects()
Init Recognition Objects.
Definition reco.cpp:123
int getVolume()
Get The volume from recognition.
Definition reco.cpp:327
~Recognition()
Recognition Destructor.
Definition reco.cpp:54
static void _stdcall sapi_callback(WPARAM wParam, LPARAM lParam)
Defines the SAPI callback.
Definition reco.cpp:225