CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
结构体 | 宏定义 | 类型定义 | 函数
command_file_reader_v2.h 文件参考
#include <stdint.h>

浏览源代码.

结构体

struct  command_info_st
 Command information 更多...
 
struct  Special_wait_count_st
 time wait after special word. 更多...
 
struct  command_string_index_st
 Index of command string, used to get command id by command string. 更多...
 
struct  voice_info_st
 Voice information 更多...
 

宏定义

#define CMD_FLAG_WAKEUP_WORD   0x01
 
#define CMD_FLAG_COMBO_WORD   0x02
 
#define CMD_FLAG_EXPECTED_WORD   0x04
 
#define CMD_FLAG_UNEXPECTED_WORD   0x08
 
#define CMD_FLAG_SPECIAL_WORD   0x10
 

类型定义

typedef struct command_info_st command_info_t
 Command information 更多...
 
typedef struct Special_wait_count_st special_wait_count_t
 time wait after special word. 更多...
 
typedef struct command_string_index_st command_string_index_t
 Index of command string, used to get command id by command string. 更多...
 
typedef struct voice_info_st voice_info_t
 Voice information 更多...
 

函数

uint32_t cmd_file_reader_init (uint32_t start_addr_in_flash)
 Initialize command file reader. 更多...
 
uint32_t cmd_file_get_model_number ()
 Get models number. 更多...
 
uint32_t cmd_file_change_model (uint32_t model_index)
 Change current model group. 更多...
 
uint32_t cmd_file_get_cur_model_id (uint32_t *p_dnn_id, uint32_t *p_asr_id)
 Get models ID. 更多...
 
uint32_t cmd_file_get_command_number ()
 Get number of commands in current model. 更多...
 
uint32_t cmd_file_read_command_table (void *table_buffer)
 Reads commands table to the specifiled buffer. 更多...
 
uint32_t cmd_file_get_special_word_number ()
 Get number of special words. 更多...
 
uint32_t cmd_file_read_special_word_table (void *table_buffer)
 Reads special words table to the specifiled buffer. 更多...
 
uint32_t cmd_file_read_string_index_table (void *table_buffer)
 Read string index table to the specifiled buffer. 更多...
 
uint32_t cmd_file_get_string_table_size ()
 Get size of string table. 更多...
 
uint32_t cmd_file_read_string_table (void *table_buffer)
 Read string table to the specifiled buffer. 更多...
 
uint32_t cmd_file_get_voice_number ()
 Get number of voice. 更多...
 
uint32_t cmd_file_read_voice_table (void *table_buffer)
 Read voice table to the specifiled buffer. 更多...
 
uint32_t cmd_file_get_max_model_group_id ()
 Get id of model group, that prun of asr is the max. 更多...
 
uint32_t cmd_file_change_cur_model_group (uint8_t model_group_id)
 
uint32_t cmd_file_get_max_command_number ()
 
uint32_t cmd_file_get_max_special_word_number ()
 
uint32_t cmd_file_get_max_cmd_string_table_size ()
 

结构体说明

◆ command_info_st

struct command_info_st

Command information

成员变量
uint16_t command_id Index of this command's voice in voice table.
uint8_t flags
uint16_t function_id Semantically related unique value.
int16_t score Use to save flags that indicate this command is a special word,or is a combo word,or is a expected word,and so on.
uint8_t score Use to save flags that indicate this command is a special word,or is a combo word,or is a expected word,and so on.
uint32_t semantic_id Identity of command.
uint16_t voice_end_index Index of this command's voice in voice table.
uint16_t voice_start_index 100 times the true float value of score.

threshold of score.

◆ Special_wait_count_st

struct Special_wait_count_st

time wait after special word.

成员变量
uint16_t index_of_cmd_table
uint8_t wait_count Identity of command.

◆ command_string_index_st

struct command_string_index_st

Index of command string, used to get command id by command string.

成员变量
uint32_t command_string_offset
uint16_t index_of_cmd_table Index of command string in table of command string.

◆ voice_info_st

struct voice_info_st

Voice information

成员变量
uint16_t voice_group
uint16_t voice_id voice group information.

宏定义说明

◆ CMD_FLAG_COMBO_WORD

#define CMD_FLAG_COMBO_WORD   0x02

◆ CMD_FLAG_EXPECTED_WORD

#define CMD_FLAG_EXPECTED_WORD   0x04

◆ CMD_FLAG_SPECIAL_WORD

#define CMD_FLAG_SPECIAL_WORD   0x10

◆ CMD_FLAG_UNEXPECTED_WORD

#define CMD_FLAG_UNEXPECTED_WORD   0x08

◆ CMD_FLAG_WAKEUP_WORD

#define CMD_FLAG_WAKEUP_WORD   0x01

类型定义说明

◆ command_info_t

Command information

◆ command_string_index_t

Index of command string, used to get command id by command string.

◆ special_wait_count_t

time wait after special word.

◆ voice_info_t

typedef struct voice_info_st voice_info_t

Voice information

函数说明

◆ cmd_file_change_cur_model_group()

uint32_t cmd_file_change_cur_model_group ( uint8_t  model_group_id)

◆ cmd_file_change_model()

uint32_t cmd_file_change_model ( uint32_t  model_index)

Change current model group.

参数
model_group_idID of medel group in cmd file.
返回
uint32_t 0:sucessful, others:error number.

◆ cmd_file_get_command_number()

uint32_t cmd_file_get_command_number ( )

Get number of commands in current model.

返回
uint32_t number of commands.

◆ cmd_file_get_cur_model_id()

uint32_t cmd_file_get_cur_model_id ( uint32_t *  p_dnn_id,
uint32_t *  p_asr_id 
)

Get models ID.

参数
p_dnn_idA pointer to a uint32_t variable used to receive dnn file id.
p_asr_idA pointer to a uint32_t variable used to receive asr file id.
p_voice_group_idA pointer to a uint32_t variable used to receive voice group id.
返回
uint32_t 0:sucessful, others:error number.

◆ cmd_file_get_max_cmd_string_table_size()

uint32_t cmd_file_get_max_cmd_string_table_size ( )

◆ cmd_file_get_max_command_number()

uint32_t cmd_file_get_max_command_number ( )

◆ cmd_file_get_max_model_group_id()

uint32_t cmd_file_get_max_model_group_id ( )

Get id of model group, that prun of asr is the max.

返回
id of model group.

◆ cmd_file_get_max_special_word_number()

uint32_t cmd_file_get_max_special_word_number ( )

◆ cmd_file_get_model_number()

uint32_t cmd_file_get_model_number ( )

Get models number.

返回
uint32_t Number of model in cmd file.

◆ cmd_file_get_special_word_number()

uint32_t cmd_file_get_special_word_number ( )

Get number of special words.

返回
uint32_t number of special words.

◆ cmd_file_get_string_table_size()

uint32_t cmd_file_get_string_table_size ( )

Get size of string table.

返回
uint32_t Size of string table.

◆ cmd_file_get_voice_number()

uint32_t cmd_file_get_voice_number ( )

Get number of voice.

返回
uint32_t Number of voice.

◆ cmd_file_read_command_table()

uint32_t cmd_file_read_command_table ( void *  table_buffer)

Reads commands table to the specifiled buffer.

参数
table_bufferThe buffer use to save commands table, provided by caller. Buffer size is larger or equal to commands number times sizeof(command_info_t).
返回
uint32_t 0:sucessful, others:error number.

◆ cmd_file_read_special_word_table()

uint32_t cmd_file_read_special_word_table ( void *  table_buffer)

Reads special words table to the specifiled buffer.

参数
table_bufferThe buffer use to save special words table, provided by caller. Buffer size is larger or equal to special words number times sizeof(special_wait_count_t).
返回
uint32_t 0:sucessful, others:error number.

◆ cmd_file_read_string_index_table()

uint32_t cmd_file_read_string_index_table ( void *  table_buffer)

Read string index table to the specifiled buffer.

参数
table_bufferThe buffer use to save string index table, provided by caller. Buffer size is larger or eaqual to commands number times sizeof(command_string_index_t).
返回
uint32_t 0:sucessful, others:error number.

◆ cmd_file_read_string_table()

uint32_t cmd_file_read_string_table ( void *  table_buffer)

Read string table to the specifiled buffer.

参数
table_bufferThe buffer use to save string table, provided by caller. Buffer size is larger or eaqual to string table size.
返回
uint32_t 0:sucessful, others:error number.

◆ cmd_file_read_voice_table()

uint32_t cmd_file_read_voice_table ( void *  table_buffer)

Read voice table to the specifiled buffer.

参数
table_bufferThe buffer used to save voice table, provided by caller. Buffer size is larger or equal to voice number times sizeof(voice_info_t).
返回
uint32_t 0:sucessful, others:error number.

◆ cmd_file_reader_init()

uint32_t cmd_file_reader_init ( uint32_t  start_addr_in_flash)

Initialize command file reader.

参数
start_addr_in_flashStart address of command file in flash.
返回
uint32_t 0:sucessful, others:error number.