⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 itrec.h

📁 本代码是语音识别的应用程序
💻 H
📖 第 1 页 / 共 2 页
字号:
*  Parameters:		asr_index			[in]  Index of Recognizer instance
*					in_file				[in]  Input speech file
*					nbest				[in]  Maximum number of desired nbest results
*					result_code			[out] Result code of the recogition
*					result				[out] Array of recognition results
*					score				[out] Array of scores associated with the results
*					speech_begin		[out] Time at which speech is detected to begin (seconds)
*					speech_end			[out] Time at which speech is detected to end (seconds)
*
*----------------------------------------------------------------------------*/
int itrec_recognize_file(int	asr_index,
						 char	*in_file,
                         int	nbest,
                         int	*result_code,
                         int	*num_result,
                         char	***result,
                         float	**score,
						 float	*speech_begin,
						 float	*speech_end);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_open_grammar
*
*  Description:		open a grammar
*
*  Parameters:		lp_grammar   		[in] pointer to the grammar structure
*
*----------------------------------------------------------------------------*/
int itrec_open_grammar(VT_GRAMMAR *lp_grammar);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_close_grammar
*
*  Description:		close a grammar
*
*  Parameters:		lp_grammar   		[in] pointer to the grammar structure
*
*----------------------------------------------------------------------------*/
int itrec_close_grammar(VT_GRAMMAR *lp_grammar);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_activate_grammar
*
*  Description:		activate a grammar in a recognizer
*
*  Parameters:	    asr_index		    [in] index of the recognizer
*					lp_grammar			[in] pointer to grammar structure
*
*----------------------------------------------------------------------------*/
int itrec_activate_grammar(int asr_index, VT_GRAMMAR *lp_grammar);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_deactivate_grammar
*
*  Description:		deactivate a grammar in a recognizer
*
*  Parameters:	    asr_index		    [in] index of the recognizer
*					lp_grammar		   	[in] pointer to grammar structure
*
*----------------------------------------------------------------------------*/
int itrec_deactivate_grammar(int asr_index, VT_GRAMMAR *lp_grammar);



/*----------------------------------------------------------------------------
*
*  Function:		itrec_dg_open
*
*  Description:		open and load a dynamic grammar in a recognizer 
*
*  Parameters:		asr_index			[in] index of the recognizer
*					lp_grammar			[in] pointer to the grammar
*
*----------------------------------------------------------------------------*/
int itrec_dg_open(int asr_index, VT_GRAMMAR *lp_grammar);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_dg_close
*
*  Description:		close a dynamic grammar in a recognizer
*
*  Parameters:		asr_index			[in] index of the recognizer
*					lp_grammar			[in] pointer to the grammar
*
*----------------------------------------------------------------------------*/
int itrec_dg_close(int asr_index, VT_GRAMMAR *lp_grammar);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_dg_activate
*
*  Description:		activate a dynamic grammar in a recognizer
*
*  Parameters:	    asr_index			[in] index of the recognizer
*					lp_grammar			[in] pointer to the grammar
*
*----------------------------------------------------------------------------*/
int itrec_dg_activate(int asr_index, VT_GRAMMAR *lp_grammar);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_dg_deactivate
*
*  Description:		deactivate a dynamic grammar in a recognizer
*
*  Parameters:	    asr_index			[in] index of the recognizer
*					lp_grammar			[in] pointer to the grammar
*
*----------------------------------------------------------------------------*/
int itrec_dg_deactivate(int asr_index, VT_GRAMMAR *lp_grammar);

/*----------------------------------------------------------------------------
*
*  Function:        itrec_parse_ans
*
*  Description:		parse the result string and get the returned slot value
*
*  Parameters:	    answer				[in]  the result string
*                   value				[out] the slot value
*                   semantic			[in]  the slot sematic string (slot name)
*                   type				[in]  the slot value type, it can be the following: 
*                                   		  VT_ANS_INT, VT_ANS_FLOAT or VT_ANS_STRING
*
*----------------------------------------------------------------------------*/
int itrec_parse_ans(char *answer, void *value, char *semantic, int type);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_attach_recognizer
*
*  Description:	    Attach to a recognizer when a session starts
*
*  Parameters:	    asr_index    		[in] index of the recognizer
*
*----------------------------------------------------------------------------*/
int itrec_attach_recognizer(int asr_index);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_attach_recognizer_ex
*
*  Description:	    Attach to a recognizer when a session starts
*
*  Parameters:	    asr_index    		[in] index of the recognizer
*                   grammarList         [in] List of grammars (with szGrammarName filled)
*                                            required in subsequent recogntion 
*                   numGrammar          [in] Number of grammars in the list
*
*----------------------------------------------------------------------------*/
int itrec_attach_recognizer_ex(int asr_index, VT_GRAMMAR *grammarList, int numGrammar);

/*----------------------------------------------------------------------------
*
*  Function:		itrec_detach_recognizer
*
*  Description:	    Detach from a recognizer when a session ends
*
*  Parameters:	    asr_index    		[in] index of the recognizer
*
*----------------------------------------------------------------------------*/
int itrec_detach_recognizer(int asr_index);

int itrec_lg_add_entry(int index, VT_LG_ENTRY *lp_entry, int num);
int itrec_lg_clear(int index);
int itrec_lg_activate(int index, char *language);
int itrec_lg_deactivate(int index);

// Voice Enrollment
int itrec_ve_set_enroll_path(int index, const char* enroll_path);  
int itrec_ve_start_enroll(int index, int language);
int itrec_ve_stop_enroll(int index);
int itrec_ve_query_enroll(int index, int* status);
int itrec_ve_activate(int index, const char* user_id);
int itrec_ve_deactivate(int index, const char* user_id);
int itrec_ve_add_entry(int index, const char* user_id, const char* entry_id, char* clash_id);
int itrec_ve_get_entry_voice(int index, const char* user_id, const char* entry_id, char* voc_file);
int itrec_ve_delete_entry(int index, const char* user_id, const char* entry_id);
int itrec_ve_get_size(int index, const char* user_id, int* size);
int itrec_ve_get_all_entries(int index, const char* user_id, int *size, char **entry_id, int buffer_size);


#ifdef __cplusplus
}
#endif

#endif /* __ITREC_H__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -