www.pudn.com > ruier_TTS_SR(vc6).rar > SpeechRecognition.h


// SpeechRecognition.h: interface for the CSpeechRecognition class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_SPEECHRECOGNITION_H__1433997F_5083_46A5_A3CF_2A51302BB357__INCLUDED_) 
#define AFX_SPEECHRECOGNITION_H__1433997F_5083_46A5_A3CF_2A51302BB357__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
/////////////////////////////////////////////////////////////// 
 
// active speech engine 
 
// 
 
#include  
 
extern CComModule _Module; 
 
#include  
 
#include  
 
#include  
 
#include  
 
 
 
 
/////////////////////////////////////////////////////////////// 
 
// speech message 
 
// 
 
#define WM_SREVENT  WM_USER+102 
 
  
 
class CSpeechRecognition   
 
{ 
 
public: 
 
    CSpeechRecognition(); 
 
    virtual ~CSpeechRecognition(); 
    // initialize 
    BOOL Initialize(HWND hWnd ,int nIDDlgItem, BOOL bIsShared = TRUE); 
    void Destroy(); 
    // start and stop 
    BOOL Start(); 
    BOOL Stop(); 
    BOOL IsDictationOn() 
    { 
        return m_bOnDictation; 
    } 
    // event handler 
    void GetText(WCHAR **ppszCoMemText, ULONG ulStart = 0, ULONG nlCount = -1); 
 
    // voice training 
    HRESULT VoiceTraining(HWND hWndParent); 
 
    // microphone setup 
    HRESULT MicrophoneSetup(HWND hWndParent); 
 
    // token list 
    HRESULT InitTokenList(HWND hWnd,int nIDDlgItem); 
	HRESULT SetVoice(HWND hWnd,int nIDDlgItem); 
    // error string 
    CString GetErrorString(); 
 
    // interface 
      CComPtr m_cpRecoEngine;        // SR engine 
      CComPtr m_cpRecoCtxt;         //Recognition contextfor dictation 
      CComPtr m_cpDictationGrammar;  // Dictation grammar  
private: 
    CString m_sError; 
    BOOL    m_bOnDictation; 
}; 
 
#endif // !defined(AFX_SPEECHRECOGNITION_H__1433997F_5083_46A5_A3CF_2A51302BB357__INCLUDED_)