![]() |
CI130X SDK API手册
2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
|
播放器 更多...
#include <stdint.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#include "sdk_default_config.h"#include "audio_play_process.h"#include "audio_play_device.h"#include "audio_play_api.h"#include "audio_play_decoder.h"#include "get_play_data.h"#include "debug_time_consuming.h"#include "ci130x_system.h"#include "ci_log.h"#include "parse_m4a_atom_containers_port.h"#include "parse_m4a_atom_containers.h"#include "adpcmdec.h"#include "ci_system_info.h"#include "ci130x_core_misc.h"#include "codec_manager.h"#include "codec_manage_outside_port.h"#include "romlib_runtime.h"#include "FreeRTOS.h"#include "task.h"#include "status_share.h"#include "ci130x_gpio.h"宏定义 | |
| #define | READBUF_SIZE (576U) |
| #define | MAX_OUTPUTBUFF_SIZE (1152U) |
| #define | MIN_OUTPUTBUFF_SIZE (576U) |
| #define | PCM_BUF_COUNT (4) |
| #define | MIN_VALID_DATA_SIZE (20U) |
| #define | TIMEOUT_CNT (40000) |
| #define | M4A_HEAD_SIZE (GET_PLAY_DATA_BUFF_SIZE*20) |
枚举 | |
| enum | { AUDIO_PLAY_FLAG_REL_END = 0, AUDIO_PLAY_FLAG_WILL_END = 1, AUDIO_PLAY_FLAG_DATA_END = 2, AUDIO_PLAY_FLAG_RESTART = 0xff } |
函数 | |
| static int32_t | task_audio_play_init_step (void) |
| 初始化播放任务所需资源 更多... | |
| static uint16_t * | get_pcm_buff_addr (void) |
| 获取最小单位的下一个pcm buff地址 更多... | |
| static uint16_t * | get_next_pcm_buff (uint32_t num) |
| 获取PCM下一个缓冲区地址 更多... | |
| static int32_t | find_decoder_ops (const char *decoder_name) |
| 检索解码器 更多... | |
| static void | para_recover_default (void) |
| 发送静音数据 更多... | |
| static int32_t | cheak_play_event (void) |
| 检查是否有播放暂停/停止事件 更多... | |
| static void | free_bak_data (void) |
| 释放备份数据区 更多... | |
| static int32_t | audio_play_decode_continue (void) |
| 数据处理调用解码器解码递交声卡驱动 更多... | |
| static void | audio_play_playing_deal (uint32_t uxBits) |
| 播放事件处理 更多... | |
| static int32_t | audio_play_start (void) |
| 启动播放 更多... | |
| static int32_t | send_get_data_msg (audio_play_msg_t *play_msg) |
| 向数据获取task发送请求数据消息 更多... | |
| uint32_t | get_audio_play_state (void) |
| 返回播放器task状态 更多... | |
| void | get_audio_format_info (audio_format_info_t *format) |
| 返回当前音频信息 更多... | |
| int32_t | fastset_audio_end_callback (CALLBACK_END_PLAY callback) |
| 快速设置end回调函数 更多... | |
| uint32_t | get_decode_sync_word_offset (void) |
| 返回当前播放位置 更多... | |
| void | clean_decode_sync_word_offset (void) |
| 清理当前播放位置 更多... | |
| void | set_play_will_finish_threshold_data_size (int size) |
| 设置播放data发送will finsh信号阈值 更多... | |
| void | do_call_callback_fun (void) |
| 调用用户回调 更多... | |
| void | registe_decoder_ops (audio_play_decoder_ops_t *registe_ops) |
| 注册解码器到解码器链表 更多... | |
| int32_t | audio_play_init (void) |
| 初始化播放任务 更多... | |
| void | set_play_speed (float play_speed) |
| 设置播放倍速 更多... | |
| void | task_audio_play (void *pvParameters) |
| 播放器调度任务 更多... | |
播放器
| #define M4A_HEAD_SIZE (GET_PLAY_DATA_BUFF_SIZE*20) |
| #define MAX_OUTPUTBUFF_SIZE (1152U) |
| #define MIN_OUTPUTBUFF_SIZE (576U) |
| #define MIN_VALID_DATA_SIZE (20U) |
| #define PCM_BUF_COUNT (4) |
| #define READBUF_SIZE (576U) |
| #define TIMEOUT_CNT (40000) |
| anonymous enum |
|
static |
数据处理调用解码器解码递交声卡驱动
| RETURN_OK | 解码正常 |
| RETURN_ERR | 解码失败 |
| int32_t audio_play_init | ( | void | ) |
初始化播放任务
| RETURN_OK | 初始化成功 |
| RETURN_ERR | 初始化失败 |
|
static |
播放事件处理
| uxBits | 事件bit |
|
static |
启动播放
| RETURN_OK | 解码正常 |
| RETURN_ERR | 解码失败 |
|
static |
检查是否有播放暂停/停止事件
| void clean_decode_sync_word_offset | ( | void | ) |
清理当前播放位置
| void do_call_callback_fun | ( | void | ) |
调用用户回调
| int32_t fastset_audio_end_callback | ( | CALLBACK_END_PLAY | callback | ) |
快速设置end回调函数
| callback | 播放结束回调函数句柄 |
| RETURN_OK | 设置成功 |
| RETURN_ERR | 设置失败 |
|
static |
检索解码器
| decoder_name | 解码器名称 |
| RETURN_OK | 检索成功 |
| RETURN_ERR | 检索失败 |
|
static |
释放备份数据区
| void get_audio_format_info | ( | audio_format_info_t * | format | ) |
返回当前音频信息
| format | 音频信息结构 |
| uint32_t get_audio_play_state | ( | void | ) |
返回播放器task状态
| uint32_t get_decode_sync_word_offset | ( | void | ) |
返回当前播放位置
|
static |
获取PCM下一个缓冲区地址
| num | 获取buff个数 |
|
static |
获取最小单位的下一个pcm buff地址
|
static |
发送静音数据
设置播放器默认参数
| void registe_decoder_ops | ( | audio_play_decoder_ops_t * | registe_ops | ) |
注册解码器到解码器链表
| registe_ops | 解码器描述符 |
|
static |
向数据获取task发送请求数据消息
| play_msg | 播放请求消息 |
| RETURN_OK | |
| RETURN_ERR |
| void set_play_speed | ( | float | play_speed | ) |
设置播放倍速
| play_speed | 浮点型,1.0为无倍速,2.0为加速为2倍速,0.5为减速为1/2倍速 |
| void set_play_will_finish_threshold_data_size | ( | int | size | ) |
设置播放data发送will finsh信号阈值
| size |
| void task_audio_play | ( | void * | pvParameters | ) |
播放器调度任务
| pvParameters | 任务参数 |
|
static |
初始化播放任务所需资源
| RETURN_OK | 初始化成功 |
| RETURN_ERR | 初始化失败 |
|
static |
| audio_format_info_t audio_format_info |
播音配置参数表
| audio_play_os_event_group_t audio_play_cmd_event_group = NULL |
播放事件标志组句柄
|
static |
| audio_play_os_queue_t audio_play_queue = NULL |
播放消息队列句柄
|
static |
| audio_play_os_task_t audio_play_task_handle |
播放任务句柄
|
static |
| uint8_t* bak_data = NULL |
| mem_file_t* bak_data_fp = NULL |
|
static |
|
static |
|
static |
| void* decoder_config_arg = NULL |
|
static |
|
static |
|
static |
|
static |
| m4a_file_info_t m4a_file_info = {0} |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| int sg_play_device_index |
|
static |
|
static |
|
static |
| uint8_t* wav_buf = NULL |
1.8.14