plugspeech.h
来自「.net 方面的开发说明资料。」· C头文件 代码 · 共 72 行
H
72 行
// ========================================================
// Speech plug (Microsoft Speech API 5.0)
//
// Design and Implementation by Floris van den Berg
// ========================================================
#ifndef PLUGSPEECH_H
#define PLUGSPEECH_H
#ifndef _WINDOWS_
#include <windows.h>
#endif
#ifndef PLUG_H
#include "Plug.h"
#endif
#ifndef _OBJBASE_H_
#include <objbase.h>
#endif
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#include <sapi.h>
#endif
#ifndef SPHelper_h
#include <sphelper.h>
#endif
#ifndef _STRING_
#include <string>
#endif
// --------------------------------------------------------
#ifndef MAX_LOADSTRING
#define MAX_LOADSTRING 256
#endif
// --------------------------------------------------------
class PlugSpeech : public Plug {
typedef Plug inherited;
public :
PlugSpeech(Grid *grid, int id);
virtual ~PlugSpeech();
friend void __stdcall SAPICallback(WPARAM wparam, LPARAM lparam);
public :
virtual bool open(PlugProperties *info);
virtual void close();
virtual bool connect(const char *host, int port);
virtual void disconnect();
virtual bool supportsSending();
public : // never call these functions directly... but always via a Plug
virtual void pollProgress();
virtual void *getReferenceData(int id);
private :
TCHAR g_szCounterDisplay[MAX_LOADSTRING];
CComPtr<ISpRecoGrammar> m_grammar;
CComPtr<ISpRecoContext> m_recotxt;
CComPtr<ISpRecognizer> m_engine;
ISpPhraseAlt *m_alt[32];
std::string m_alt_string[32];
ULONG m_alt_count;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?