qisr.h
Go to the documentation of this file.
1 
28 #ifndef __QISR_H__
29 #define __QISR_H__
30 
31 #if __cplusplus
32 extern "C" {
33 #endif /* C++ */
34 
35 #include "msp_types.h"
36 
49 const char* MSPAPI QISRSessionBegin(const char* grammarList, const char* params, int* errorCode);
50 typedef const char*(MSPAPI* Proc_QISRSessionBegin)(const char* grammarList, const char* params, int* result);
51 #if MSP_WCHAR_SUPPORT
52 const wchar_t* MSPAPI QISRSessionBeginW(const wchar_t* grammarList, const wchar_t* params, int* result);
53 typedef const wchar_t*(MSPAPI* Proc_QISRSessionBeginW)(const wchar_t* grammarList, const wchar_t* params, int* result);
54 #endif
55 
71 int MSPAPI QISRAudioWrite(const char* sessionID, const void* waveData, unsigned int waveLen, int audioStatus,
72  int* epStatus, int* recogStatus);
73 typedef int(MSPAPI* Proc_QISRAudioWrite)(const char* sessionID, const void* waveData, unsigned int waveLen,
74  int audioStatus, int* epStatus, int* recogStatus);
75 #if MSP_WCHAR_SUPPORT
76 int MSPAPI QISRAudioWriteW(const wchar_t* sessionID, const void* waveData, unsigned int waveLen, int audioStatus,
77  int* epStatus, int* recogStatus);
78 typedef int(MSPAPI* Proc_QISRAudioWriteW)(const wchar_t* sessionID, const void* waveData, unsigned int waveLen,
79  int audioStatus, int* epStatus, int* recogStatus);
80 #endif
81 
95 const char* MSPAPI QISRGetResult(const char* sessionID, int* rsltStatus, int waitTime, int* errorCode);
96 typedef const char*(MSPAPI* Proc_QISRGetResult)(const char* sessionID, int* rsltStatus, int waitTime, int* errorCode);
97 #if MSP_WCHAR_SUPPORT
98 const wchar_t* MSPAPI QISRGetResultW(const wchar_t* sessionID, int* rsltStatus, int waitTime, int* errorCode);
99 typedef const wchar_t*(MSPAPI* Proc_QISRGetResultW)(const wchar_t* sessionID, int* rsltStatus, int waitTime,
100  int* errorCode);
101 #endif
102 
116 const char* MSPAPI QISRGetBinaryResult(const char* sessionID, unsigned int* rsltLen, int* rsltStatus, int waitTime,
117  int* errorCode);
118 typedef const char*(MSPAPI* Proc_QISRGetBinaryResult)(const char* sessionID, unsigned int* rsltLen, int* rsltStatus,
119  int waitTime, int* errorCode);
120 #if MSP_WCHAR_SUPPORT
121 const wchar_t* MSPAPI QISRGetBinaryResultW(const wchar_t* sessionID, unsigned int* rsltLen, int* rsltStatus,
122  int waitTime, int* errorCode);
123 typedef const wchar_t*(MSPAPI* Proc_QISRGetBinaryResultW)(const wchar_t* sessionID, unsigned int* rsltLen,
124  int* rsltStatus, int waitTime, int* errorCode);
125 #endif
126 
138 int MSPAPI QISRSessionEnd(const char* sessionID, const char* hints);
139 typedef int(MSPAPI* Proc_QISRSessionEnd)(const char* sessionID, const char* hints);
140 #if MSP_WCHAR_SUPPORT
141 int MSPAPI QISRSessionEndW(const wchar_t* sessionID, const wchar_t* hints);
142 typedef int(MSPAPI* Proc_QISRSessionEndW)(const wchar_t* sessionID, const wchar_t* hints);
143 #endif
144 
158 int MSPAPI QISRGetParam(const char* sessionID, const char* paramName, char* paramValue, unsigned int* valueLen);
159 typedef int(MSPAPI* Proc_QISRGetParam)(const char* sessionID, const char* paramName, char* paramValue,
160  unsigned int* valueLen);
161 #if MSP_WCHAR_SUPPORT
162 int MSPAPI QISRGetParamW(const wchar_t* sessionID, const wchar_t* paramName, wchar_t* paramValue,
163  unsigned int* valueLen);
164 typedef int(MSPAPI* Proc_QISRGetParamW)(const wchar_t* sessionID, const wchar_t* paramName, wchar_t* paramValue,
165  unsigned int* valueLen);
166 #endif
167 
181 int MSPAPI QISRSetParam(const char* sessionID, const char* paramName, const char* paramValue);
182 typedef int(MSPAPI* Proc_QISRSetParam)(const char* sessionID, const char* paramName, const char* paramValue);
183 #if MSP_WCHAR_SUPPORT
184 int MSPAPI QISRSetParamW(const wchar_t* sessionID, const wchar_t* paramName, const wchar_t* paramValue);
185 typedef int(MSPAPI* Proc_QISRSetParamW)(const wchar_t* sessionID, const wchar_t* paramName, const wchar_t* paramValue);
186 #endif
187 
188 typedef void (*recog_result_ntf_handler)(const char* sessionID, const char* result, int resultLen, int resultStatus,
189  void* userData);
190 typedef void (*recog_status_ntf_handler)(const char* sessionID, int type, int status, int param1, const void* param2,
191  void* userData);
192 typedef void (*recog_error_ntf_handler)(const char* sessionID, int errorCode, const char* detail, void* userData);
193 int MSPAPI QISRRegisterNotify(const char* sessionID, recog_result_ntf_handler rsltCb, recog_status_ntf_handler statusCb,
194  recog_error_ntf_handler errCb, void* userData);
195 
196 typedef int (*UserCallBack)(int, const char*, void*);
197 typedef int (*GrammarCallBack)(int, const char*, void*);
198 typedef int (*LexiconCallBack)(int, const char*, void*);
199 
200 int MSPAPI QISRBuildGrammar(const char* grammarType, const char* grammarContent, unsigned int grammarLength,
201  const char* params, GrammarCallBack callback, void* userData);
202 typedef int(MSPAPI* Proc_QISRBuildGrammar)(const char* grammarType, const char* grammarContent,
203  unsigned int grammarLength, const char* params, GrammarCallBack callback,
204  void* userData);
205 #if MSP_WCHAR_SUPPORT
206 int MSPAPI QISRBuildGrammarW(const wchar_t* grmmarType, const wchar_t* grammarContent, unsigned int grammarLength,
207  const wchar_t* params, GrammarCallBack callback, void* userData);
208 typedef int(MSPAPI* Proc_QISRBuildGrammarW)(const wchar_t* grmmarType, const wchar_t* grammarContent,
209  unsigned int grammarLength, const wchar_t* params, GrammarCallBack callback,
210  void* userData);
211 #endif
212 
213 int MSPAPI QISRUpdateLexicon(const char* lexiconName, const char* lexiconContent, unsigned int lexiconLength,
214  const char* params, LexiconCallBack callback, void* userData);
215 typedef int(MSPAPI* Proc_QISRUpdataLexicon)(const char* lexiconName, const char* lexiconContent,
216  unsigned int lexiconLength, const char* params, LexiconCallBack callback,
217  void* userData);
218 #if MSP_WCHAR_SUPPORT
219 int MSPAPI QISRUpdateLexiconW(const wchar_t* lexiconName, const wchar_t* lexiconContent, unsigned int lexiconLength,
220  const wchar_t* params, LexiconCallBack callback, void* userData);
221 typedef int(MSPAPI Proc_QISRUpdateLexiconW)(const wchar_t* lexiconName, const wchar_t* lexiconContent,
222  unsigned int lexiconLength, const wchar_t* params, LexiconCallBack callback,
223  void* userData);
224 #endif
225 #if __cplusplus
226 } /* extern "C" */
227 #endif /* C++ */
228 
229 #endif /* __QISR_H__ */
int MSPAPI QISRRegisterNotify(const char *sessionID, recog_result_ntf_handler rsltCb, recog_status_ntf_handler statusCb, recog_error_ntf_handler errCb, void *userData)
const char *MSPAPI QISRGetBinaryResult(const char *sessionID, unsigned int *rsltLen, int *rsltStatus, int waitTime, int *errorCode)
int MSPAPI QISRSessionEnd(const char *sessionID, const char *hints)
#define MSPAPI
Definition: msp_types.h:8
int(MSPAPI * Proc_QISRSetParam)(const char *sessionID, const char *paramName, const char *paramValue)
Definition: qisr.h:182
int(MSPAPI * Proc_QISRBuildGrammar)(const char *grammarType, const char *grammarContent, unsigned int grammarLength, const char *params, GrammarCallBack callback, void *userData)
Definition: qisr.h:202
void(* recog_status_ntf_handler)(const char *sessionID, int type, int status, int param1, const void *param2, void *userData)
Definition: qisr.h:190
int(MSPAPI * Proc_QISRSessionEnd)(const char *sessionID, const char *hints)
Definition: qisr.h:139
const char *MSPAPI QISRSessionBegin(const char *grammarList, const char *params, int *errorCode)
int MSPAPI QISRBuildGrammar(const char *grammarType, const char *grammarContent, unsigned int grammarLength, const char *params, GrammarCallBack callback, void *userData)
const char *(MSPAPI * Proc_QISRGetBinaryResult)(const char *sessionID, unsigned int *rsltLen, int *rsltStatus, int waitTime, int *errorCode)
Definition: qisr.h:118
int(* UserCallBack)(int, const char *, void *)
Definition: qisr.h:196
int(* GrammarCallBack)(int, const char *, void *)
Definition: qisr.h:197
int(MSPAPI * Proc_QISRGetParam)(const char *sessionID, const char *paramName, char *paramValue, unsigned int *valueLen)
Definition: qisr.h:159
int MSPAPI QISRUpdateLexicon(const char *lexiconName, const char *lexiconContent, unsigned int lexiconLength, const char *params, LexiconCallBack callback, void *userData)
const char *(MSPAPI * Proc_QISRGetResult)(const char *sessionID, int *rsltStatus, int waitTime, int *errorCode)
Definition: qisr.h:96
int(* LexiconCallBack)(int, const char *, void *)
Definition: qisr.h:198
int(MSPAPI * Proc_QISRUpdataLexicon)(const char *lexiconName, const char *lexiconContent, unsigned int lexiconLength, const char *params, LexiconCallBack callback, void *userData)
Definition: qisr.h:215
void(* recog_result_ntf_handler)(const char *sessionID, const char *result, int resultLen, int resultStatus, void *userData)
Definition: qisr.h:188
const char *(MSPAPI * Proc_QISRSessionBegin)(const char *grammarList, const char *params, int *result)
Definition: qisr.h:50
const char *MSPAPI QISRGetResult(const char *sessionID, int *rsltStatus, int waitTime, int *errorCode)
int MSPAPI QISRAudioWrite(const char *sessionID, const void *waveData, unsigned int waveLen, int audioStatus, int *epStatus, int *recogStatus)
void(* recog_error_ntf_handler)(const char *sessionID, int errorCode, const char *detail, void *userData)
Definition: qisr.h:192
int MSPAPI QISRGetParam(const char *sessionID, const char *paramName, char *paramValue, unsigned int *valueLen)
int(MSPAPI * Proc_QISRAudioWrite)(const char *sessionID, const void *waveData, unsigned int waveLen, int audioStatus, int *epStatus, int *recogStatus)
Definition: qisr.h:73
int MSPAPI QISRSetParam(const char *sessionID, const char *paramName, const char *paramValue)


xbot_talker
Author(s): wangxiaoyun
autogenerated on Sat Oct 10 2020 03:27:53