Yabin Li
2023-04-24 7ab2e5cf22bbb31808bcacf84c054c710e4e6a93
funasr/runtime/onnxruntime/include/libfunasrapi.h
@@ -35,7 +35,6 @@
 RASRM_CTC_GREEDY_SEARCH=0,
 RASRM_CTC_RPEFIX_BEAM_SEARCH = 1,
 RASRM_ATTENSION_RESCORING = 2,
}FUNASR_MODE;
typedef enum {
@@ -43,33 +42,24 @@
   FUNASR_MODEL_PADDLE_2 = 1,
   FUNASR_MODEL_K2 = 2,
   FUNASR_MODEL_PARAFORMER = 3,
}FUNASR_MODEL_TYPE;
typedef void (* QM_CALLBACK)(int nCurStep, int nTotal); // nTotal: total steps; nCurStep: Current Step.
typedef void (* QM_CALLBACK)(int cur_step, int n_total); // n_total: total steps; cur_step: Current Step.
   
// APIs for qmasr
_FUNASRAPI FUNASR_HANDLE  FunASRInit(const char* szModelDir, int nThread, bool quantize);
// APIs for funasr
_FUNASRAPI FUNASR_HANDLE  FunASRInit(const char* sz_model_dir, int thread_num, bool quantize=false, bool use_vad=false, bool use_punc=false);
// if not give a fn_callback ,it should be NULL
_FUNASRAPI FUNASR_RESULT   FunASRRecogBuffer(FUNASR_HANDLE handle, const char* sz_buf, int n_len, FUNASR_MODE mode, QM_CALLBACK fn_callback, bool use_vad=false, bool use_punc=false);
_FUNASRAPI FUNASR_RESULT   FunASRRecogPCMBuffer(FUNASR_HANDLE handle, const char* sz_buf, int n_len, int sampling_rate, FUNASR_MODE mode, QM_CALLBACK fn_callback, bool use_vad=false, bool use_punc=false);
_FUNASRAPI FUNASR_RESULT   FunASRRecogPCMFile(FUNASR_HANDLE handle, const char* sz_filename, int sampling_rate, FUNASR_MODE mode, QM_CALLBACK fn_callback, bool use_vad=false, bool use_punc=false);
_FUNASRAPI FUNASR_RESULT   FunASRRecogFile(FUNASR_HANDLE handle, const char* sz_wavfile, FUNASR_MODE mode, QM_CALLBACK fn_callback, bool use_vad=false, bool use_punc=false);
// if not give a fnCallback ,it should be NULL
_FUNASRAPI FUNASR_RESULT   FunASRRecogBuffer(FUNASR_HANDLE handle, const char* szBuf, int nLen, FUNASR_MODE Mode, QM_CALLBACK fnCallback);
_FUNASRAPI FUNASR_RESULT   FunASRRecogPCMBuffer(FUNASR_HANDLE handle, const char* szBuf, int nLen, int sampling_rate, FUNASR_MODE Mode, QM_CALLBACK fnCallback);
_FUNASRAPI FUNASR_RESULT   FunASRRecogPCMFile(FUNASR_HANDLE handle, const char* szFileName, int sampling_rate, FUNASR_MODE Mode, QM_CALLBACK fnCallback);
_FUNASRAPI FUNASR_RESULT   FunASRRecogFile(FUNASR_HANDLE handle, const char* szWavfile, FUNASR_MODE Mode, QM_CALLBACK fnCallback);
_FUNASRAPI const char*   FunASRGetResult(FUNASR_RESULT Result,int nIndex);
_FUNASRAPI const int      FunASRGetRetNumber(FUNASR_RESULT Result);
_FUNASRAPI void         FunASRFreeResult(FUNASR_RESULT Result);
_FUNASRAPI void         FunASRUninit(FUNASR_HANDLE Handle);
_FUNASRAPI const float   FunASRGetRetSnippetTime(FUNASR_RESULT Result);
_FUNASRAPI const char*   FunASRGetResult(FUNASR_RESULT result,int n_index);
_FUNASRAPI const int   FunASRGetRetNumber(FUNASR_RESULT result);
_FUNASRAPI void         FunASRFreeResult(FUNASR_RESULT result);
_FUNASRAPI void         FunASRUninit(FUNASR_HANDLE handle);
_FUNASRAPI const float   FunASRGetRetSnippetTime(FUNASR_RESULT result);
#ifdef __cplusplus