30#error "Audio library is NOT supported by SubCore."
37#include <audio/audio_high_level_api.h>
38#include <audio/utilities/wav_containerformat_parser.h>
39#include <memutils/simple_fifo/CMN_SimpleFifo.h>
46#define MEDIAPLAYER_LOG_DEBUG
48#define print_err printf
50#ifdef MEDIAPLAYER_LOG_DEBUG
51#define print_dbg(...) printf(__VA_ARGS__)
53#define print_dbg(x...)
60#define MEDIAPLAYER_ECODE_OK 0
61#define MEDIAPLAYER_ECODE_COMMAND_ERROR 1
62#define MEDIAPLAYER_ECODE_SIMPLEFIFO_ERROR 2
63#define MEDIAPLAYER_ECODE_FILEACCESS_ERROR 3
64#define MEDIAPLAYER_ECODE_FILEEND 4
65#define MEDIAPLAYER_ECODE_SHARED_MEMORY_ERROR 5
66#define MEDIAPLAYER_ECODE_WAV_PARSER_ERROR 6
67#define MEDIAPLAYER_ECODE_BUFFERSIZE_ERROR 7
68#define MEDIAPLAYER_ECODE_BUFFERALLOC_ERROR 8
70#define MEDIAPLAYER_BUF_FRAME_NUM 8
71#define MEDIAPLAYER_BUF_FRAME_SIZE 6144
72#define MEDIAPLAYER_BUF_SIZE (MEDIAPLAYER_BUF_FRAME_NUM * MEDIAPLAYER_BUF_FRAME_SIZE)
148 AudioAttentionCb attcb
162 MediaPlayerCallback mpcb
176 uint8_t output_device,
177 MediaPlayerCallback mpcb
190 MediaPlayerCallback mpcb,
191 uint32_t player_bufsize
204 uint8_t output_device,
205 MediaPlayerCallback mpcb,
206 uint32_t player_bufsize
224 uint32_t sampling_rate,
225 uint8_t channel_number
242 uint32_t sampling_rate,
244 uint8_t channel_number
261 const char *codec_path,
262 uint32_t sampling_rate,
263 uint8_t channel_number
279 const char *codec_path,
280 uint32_t sampling_rate,
282 uint8_t channel_number
298 DecodeDoneCallback dccb
339 AsRequestNextType type
388 : m_player0_simple_fifo_buf(NULL)
389 , m_player1_simple_fifo_buf(NULL)
396 CMN_SimpleFifoHandle m_player0_simple_fifo_handle;
397 CMN_SimpleFifoHandle m_player1_simple_fifo_handle;
399 uint32_t *m_player0_simple_fifo_buf;
400 uint32_t *m_player1_simple_fifo_buf;
402 AsPlayerInputDeviceHdlrForRAM m_player0_input_device_handler;
403 AsPlayerInputDeviceHdlrForRAM m_player1_input_device_handler;
405 char m_es_player0_buf[MEDIAPLAYER_BUF_FRAME_SIZE];
406 char m_es_player1_buf[MEDIAPLAYER_BUF_FRAME_SIZE];
408 err_t write_fifo(
File& myFile,
char *p_es_buf, CMN_SimpleFifoHandle *handle);
409 err_t write_fifo(uint8_t *data, uint32_t size, CMN_SimpleFifoHandle *handle);
411 bool check_decode_dsp(uint8_t codec_type,
const char *path);
The File class allows for reading from and writing to individual files on the File System.
Definition: File.h:55
unsigned int err_t
Definition: Audio.h:108