![]() |
CI130X SDK API手册
2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
|
播放器接口函数 更多...
#include "audio_play_api.h"
#include "audio_play_process.h"
#include "get_play_data.h"
#include "ci130x_system.h"
#include "ci130x_core_misc.h"
#include <string.h>
#include "ci_log.h"
#include "romlib_runtime.h"
宏定义 | |
#define | AUDIO_PLAY_VERSION 2L |
#define | AUDIO_PLAY_SUBVERSION 8L |
#define | AUDIO_PLAY_REVISION 3L |
函数 | |
int32_t | get_audio_play_version (char version[3]) |
获取播放器组件版本号 更多... | |
void | pause_audio_play_audio (const char *dir, const char *name, int offset, const char *decoder_name, CALLBACK_END_PLAY end_paly_callback) |
暂停当前的audio播放新的audio 更多... | |
int32_t | continue_history_play (CALLBACK_END_PLAY end_paly_callback) |
播放最近一次被打断的mp3 更多... | |
int32_t | play_audio (const char *dir_or_url, const char *name, int offset, const char *decoder_name, CALLBACK_END_PLAY end_paly_callback) |
从sd卡或网络播放音乐 更多... | |
int32_t | play_prompt (uint32_t data_addr, uint32_t data_addr_num, CALLBACK_END_PLAY end_paly_callback) |
播放ADPCM 更多... | |
void | pause_audio_play_prompt (uint32_t data_addr, uint32_t data_addr_num, CALLBACK_END_PLAY end_paly_callback) |
暂停当前的audio播放adpcm 更多... | |
int32_t | play_with_outside (int offset, const char *decoder_name, CALLBACK_END_PLAY end_paly_callback) |
播放来自外部的数据源音频 更多... | |
int32_t | play_with_outside_v2 (int offset, const char *decoder_name, CALLBACK_END_PLAY end_paly_callback) |
播放来自外部的数据源音频 更多... | |
int32_t | stop_play (CALLBACK_END_PLAY end_paly_callback, void *xHigherPriorityTaskWoken) |
停止播放 更多... | |
int32_t | pause_play (CALLBACK_END_PLAY end_paly_callback, void *xHigherPriorityTaskWoken) |
暂停播放 更多... | |
uint32_t | get_play_offset (void) |
获取当前的播放进度, 更多... | |
uint32_t | get_data_load_offset (void) |
获取读入数据缓冲器进度, 更多... | |
播放器接口函数
#define AUDIO_PLAY_REVISION 3L |
revise version number
#define AUDIO_PLAY_SUBVERSION 8L |
minor version number
#define AUDIO_PLAY_VERSION 2L |
majar version number
int32_t continue_history_play | ( | CALLBACK_END_PLAY | end_paly_callback | ) |
播放最近一次被打断的mp3
end_paly_callback | 结束播放回调函数指针 |
RETURN_OK | 播放启动成功 |
RETURN_ERR | 播放启动失败 |
int32_t get_audio_play_version | ( | char | version[3] | ) |
获取播放器组件版本号
version | 版本号buf,3byte |
RETURN_OK | 获取成功 |
RETURN_ERR | 获取失败 |
uint32_t get_data_load_offset | ( | void | ) |
获取读入数据缓冲器进度,
uint32_t get_play_offset | ( | void | ) |
获取当前的播放进度,
void pause_audio_play_audio | ( | const char * | dir, |
const char * | name, | ||
int | offset, | ||
const char * | decoder_name, | ||
CALLBACK_END_PLAY | end_paly_callback | ||
) |
暂停当前的audio播放新的audio
dir | 文件路径 |
name | 文件名 |
offset | 播放偏移 |
decoder_name | 解码器名称 |
end_paly_callback | 结束播放回调函数指针 |
void pause_audio_play_prompt | ( | uint32_t | data_addr, |
uint32_t | data_addr_num, | ||
CALLBACK_END_PLAY | end_paly_callback | ||
) |
暂停当前的audio播放adpcm
data_addr | 播报词在flash内地址 |
end_paly_callback | 结束播放回调函数指针 |
int32_t pause_play | ( | CALLBACK_END_PLAY | end_paly_callback, |
void * | xHigherPriorityTaskWoken | ||
) |
暂停播放
end_paly_callback | 结束播放回调函数指针 |
RETURN_OK | 暂停成功 |
RETURN_ERR | 暂停失败(可能已经停止或未进行播放) |
int32_t play_audio | ( | const char * | dir_or_url, |
const char * | name, | ||
int | offset, | ||
const char * | decoder_name, | ||
CALLBACK_END_PLAY | end_paly_callback | ||
) |
从sd卡或网络播放音乐
dir_or_url | 播放路径 |
name | 文件名称 |
offset | 播放偏移 |
decoder_name | 解码器名称 |
end_paly_callback | 结束播放回调函数指针 |
RETURN_OK | 播放启动成功 |
RETURN_ERR | 播放启动失败 |
int32_t play_prompt | ( | uint32_t | data_addr, |
uint32_t | data_addr_num, | ||
CALLBACK_END_PLAY | end_paly_callback | ||
) |
播放ADPCM
data_addr | 播报词在flash内地址 |
end_paly_callback | 结束播放回调函数指针 |
RETURN_OK | 播放启动成功 |
RETURN_ERR | 播放启动失败 |
int32_t play_with_outside | ( | int | offset, |
const char * | decoder_name, | ||
CALLBACK_END_PLAY | end_paly_callback | ||
) |
播放来自外部的数据源音频
用于播放外部数据源音频,需要调用外部数据流写入原始数据
decoder_name | 解码器名称 |
end_paly_callback | 结束播放回调函数指针 |
RETURN_OK | 播放启动成功 |
RETURN_ERR | 播放启动失败 |
int32_t play_with_outside_v2 | ( | int | offset, |
const char * | decoder_name, | ||
CALLBACK_END_PLAY | end_paly_callback | ||
) |
播放来自外部的数据源音频
用于播放外部数据源音频,需要调用外部数据流写入原始数据
decoder_name | 解码器名称 |
end_paly_callback | 结束播放回调函数指针 |
RETURN_OK | 播放启动成功 |
RETURN_ERR | 播放启动失败 |
int32_t stop_play | ( | CALLBACK_END_PLAY | end_paly_callback, |
void * | xHigherPriorityTaskWoken | ||
) |
停止播放
end_paly_callback | 结束播放回调函数指针 |
RETURN_OK | 停止成功 |
RETURN_ERR | 停止失败(可能已经停止或未进行播放) |