CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
结构体 | 类型定义 | 函数 | 变量
prompt_player.c 文件参考
#include <stdio.h>
#include "command_file_reader.h"
#include "command_info.h"
#include "audio_play_api.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "semphr.h"
#include "ci_log.h"
#include "prompt_player.h"
#include "codec_manager.h"
#include "status_share.h"
#include "ci_flash_data_info.h"
#include "asr_api.h"
#include "timers.h"

结构体

struct  voice_play_info_st
 
struct  prompt_player_st
 
struct  multi_id_info_st
 

类型定义

typedef struct voice_play_info_st voice_play_info_t
 
typedef struct prompt_player_st prompt_player_t
 
typedef struct multi_id_info_st multi_id_info_t
 

函数

bool get_mute_voice_in_state (void)
 Get the mute voice in state object, DENOISE will used this function 更多...
 
static void combination_callback (int32_t play_cb_state)
 
static void pop_from_play_queue ()
 
static void clean_play_queue ()
 
static int prompt_play_inner (voice_play_info_t *p_voice_play_info, bool from_callback)
 
static uint32_t voice_play_info_add_to_queue (voice_play_info_t *p_voice_play_info)
 
void prompt_player_enable (FunctionalState state)
 设置提示音播放器是否使能。 更多...
 
uint32_t prompt_play_by_cmd_handle (cmd_handle_t cmd_handle, int select_index, play_done_callback_t play_done_callback, bool preemptive)
 通过命令词句柄开始播放指定的命令词对应的提示音。此函数为异步调用函数,也就是此函数会在启动播放后立即返回,不会等到播放结束才返回。\ 在播放结束时会通过调用play_done_callback所指定的回调函数来通知播放结束事件。 更多...
 
uint32_t prompt_play_by_voice_id (uint16_t voice_id, play_done_callback_t play_done_callback, bool preemptive)
 通过音频文件ID开始播放指定的命令词对应的提示音, 只播放一个文件,没有选择播放和组合音频的功能。此函数为异步调用函数,也就是此函\ 数会在启动播放后立即返回,不会等到播放结束才返回。在播放结束时会通过调用play_done_callback所指定的回调函数来通知播放结束事件。 更多...
 
uint32_t prompt_play_by_cmd_id (uint16_t cmd_id, int select_index, play_done_callback_t play_done_callback, bool preemptive)
 通过命令词ID开始播放指定的命令词对应的提示音。此函数为异步调用函数,也就是此函数会在启动播放后立即返回,不会等到播放结束才返回。\ 在播放结束时会通过调用play_done_callback所指定的回调函数来通知播放结束事件。 更多...
 
uint32_t prompt_play_by_semantic_id (uint32_t semantic_id, int select_index, play_done_callback_t play_done_callback, bool preemptive)
 通过命令词语义ID开始播放指定的命令词对应的提示音。此函数为异步调用函数,也就是此函数会在启动播放后立即返回,不会等到播放结束才返回。\ 在播放结束时会通过调用play_done_callback所指定的回调函数来通知播放结束事件。 更多...
 
uint32_t prompt_play_by_cmd_string (char *cmd_string, int select_index, play_done_callback_t play_done_callback, bool preemptive)
 通过命令词字符串开始播放指定的命令词对应的提示音。此函数为异步调用函数,也就是此函数会在启动播放后立即返回,不会等到播放结束才返回。\ 在播放结束时会通过调用play_done_callback所指定的回调函数来通知播放结束事件。 更多...
 
uint32_t prompt_play_by_multi_cmd_id (prompt_play_info_t *p_play_info, int number, play_done_callback_t play_done_callback)
 一次启动多个提示音播放, 多个提示音依次播放。如果当前有提示音正在播放,会被立即打断。 更多...
 
uint32_t prompt_is_playing ()
 查询提示音播放器是否正在播放提示音。 更多...
 
uint32_t prompt_stop_play ()
 停止当前正在播放的提示音。 更多...
 

变量

static prompt_player_t prompt_player
 

详细描述

版本
0.1
日期
2019-04-30

结构体说明

◆ voice_play_info_st

struct voice_play_info_st
成员变量
cmd_handle_t cmd_handle
uint16_t end_index
play_done_callback_t play_done_callback 选择播报索引, >=0:指定的选择索引号;-1:交由系统选择;-2:指定为voice_id播报
int select_index
uint16_t start_index

◆ prompt_player_st

struct prompt_player_st
成员变量
uint8_t combination_index
uint32_t combination_list[16]
uint8_t combination_number 语音输入mute标志
FunctionalState enabled_flag
bool mute_voice_in_flag
uint8_t pause_asr_count
QueueHandle_t play_queue 提示音播报是否使能
SemaphoreHandle_t semaphore 播放队列

◆ multi_id_info_st

struct multi_id_info_st
成员变量
uint32_t id
uint16_t select_index

类型定义说明

◆ multi_id_info_t

◆ prompt_player_t

◆ voice_play_info_t

函数说明

◆ clean_play_queue()

static void clean_play_queue ( )
static

◆ combination_callback()

static void combination_callback ( int32_t  play_cb_state)
static

◆ get_mute_voice_in_state()

bool get_mute_voice_in_state ( void  )

Get the mute voice in state object, DENOISE will used this function

返回
true mute voice in, data is 0
false voice in is normal

◆ pop_from_play_queue()

static void pop_from_play_queue ( )
static

◆ prompt_play_inner()

static int prompt_play_inner ( voice_play_info_t p_voice_play_info,
bool  from_callback 
)
static

◆ prompt_stop_play()

uint32_t prompt_stop_play ( )

停止当前正在播放的提示音。

返回
uint32_t 0:停止成功, nonzero:停止失败。

◆ voice_play_info_add_to_queue()

static uint32_t voice_play_info_add_to_queue ( voice_play_info_t p_voice_play_info)
static

变量说明

◆ prompt_player

prompt_player_t prompt_player
static
初始值:
=
{
0,
NULL,
false,
0,
0,
0,
}
Definition: ci130x_system.h:86
#define NULL
Definition: SEGGER_RTT.c:160