![]() |
CI13LC SDK API手册
2.1.1
本手册用于描述CI13LC SDK各个组件和驱动API
|
#include <string.h>#include "simple_mp3_player.h"#include "FreeRTOS.h"#include "queue.h"#include "romlib_api.h"#include "codec_manager.h"#include "ci_log_config.h"#include "mp3dec.h"#include "ci_log.h"#include "board.h"#include "flash_rw_process.h"结构体 | |
| struct | smp_msg_t |
| struct | ci_mp3_header_t |
| struct | smp_info_t |
宏定义 | |
| #define | SMP_SOURCE_DATA_BUF_SIZE 1024 |
| #define | SMP_MSG_QUEUE_LENGHT 20 |
| #define | SMP_PCM_BUF_COUNT 4 |
枚举 | |
| enum | smp_status_t { SMP_STATE_START, SMP_STATE_PLAY, SMP_STATE_STOP, SMP_STATE_IDLE } |
函数 | |
| static void | task_simple_mp3_player (void *pvParameters) |
| Task function of player 更多... | |
| static void | smp_send_msg (smp_msg_t *msg, BaseType_t *xHigherPriorityTaskWoken) |
| int | smp_init (void) |
| Initialize the simple mp3 player module. 更多... | |
| int | smp_play (uint32_t data_addr, void *play_end_callback) |
| Start playing. 更多... | |
| void | smp_stop () |
| void | audio_play_set_vol_gain (int32_t gain) |
| 调节播放音量 更多... | |
| void | audio_play_hw_pa_da_ctl (FunctionalState cmd, bool is_control_pa) |
| pa、da控制,可选择是否控制功放 更多... | |
| static int | smp_start_play_inner (smp_msg_t *msg) |
| Inner start playing function. 更多... | |
| static void | wait_codec_play_finish () |
| static int | smp_decode_one_frame (void) |
| Decode one frame. 更多... | |
| static int | smp_stop_play_inner (int32_t play_cb_state) |
变量 | |
| smp_info_t | smp_info |
| struct smp_msg_t |
| 成员变量 | ||
|---|---|---|
| uint32_t | data_addr | |
| smp_msg_id_t | msg_id | |
| SMP_PLAY_END_CALLBACK | play_end_callback | |
| struct ci_mp3_header_t |
| struct smp_info_t |
| 成员变量 | ||
|---|---|---|
| uint8_t | channels | |
| uint32_t | data_addr | |
| uint32_t | decode_frame_count | |
| HMP3Decoder | decoder_handle | |
| uint32_t | frame_pcm_size | |
| QueueHandle_t | msg_queue | |
| uint32_t | output_samples | |
| short * | pcm_buffer | |
| uint32_t | pcm_buffer_size | |
| SMP_PLAY_END_CALLBACK | play_end_callback | |
| uint32_t | sample_rate | |
| uint32_t | source_buf_bytes_left | |
| uint8_t | source_data_buf[1024] | |
| uint32_t | source_file_bytes_left | |
| uint32_t | source_frame_size | |
| smp_status_t | state | |
| uint32_t | total_pcm_size | |
| #define SMP_MSG_QUEUE_LENGHT 20 |
| #define SMP_PCM_BUF_COUNT 4 |
| #define SMP_SOURCE_DATA_BUF_SIZE 1024 |
| void audio_play_hw_pa_da_ctl | ( | FunctionalState | cmd, |
| bool | is_control_pa | ||
| ) |
pa、da控制,可选择是否控制功放
| cmd | pa使能或失能 |
| void audio_play_set_vol_gain | ( | int32_t | gain | ) |
调节播放音量
| gain | 音量(0–100) |
|
static |
Decode one frame.
| int smp_init | ( | void | ) |
Initialize the simple mp3 player module.
| int smp_play | ( | uint32_t | data_addr, |
| void * | play_end_callback | ||
| ) |
Start playing.
| data_addr | uint32_t It's used to specifiy the address of the mp3 data. |
| play_end_callback | A pointer to a function that will be called when play to end. |
|
static |
|
static |
Inner start playing function.
| msg | A pointer to a smp_msg_t structure used to input data address and callback function. |
| void smp_stop | ( | ) |
|
static |
|
static |
Task function of player
| pvParameters | Task parameter. |
|
static |
| smp_info_t smp_info |
1.8.14