Microchip® Advanced Software Framework

mp3_libmad_player.h File Reference
#include "compiler.h"

Functions

bool play_mp3 (const char *filename, bool verbose)
 This is the function called by ushell_task() to perform all the MP3 decoding. More...
 

bool play_mp3 ( const char *  filename,
bool  verbose 
)

This is the function called by ushell_task() to perform all the MP3 decoding.

Returns
false in case of error, otherwise return true.

It instantiates a decoder object and configures it with the input, output, and error callback functions above. A single call to mad_decoder_run() continues until a callback function returns MAD_FLOW_STOP (to stop decoding) or MAD_FLOW_BREAK (to stop decoding and signal an error).

References St_id3size::appended_tag, audio_mixer_close, audio_mixer_create_buffers, audio_mixer_dacs_flush, cptms, error(), file_close(), file_open(), file_seek(), filename, FilePosPtr, FOPEN_MODE_R, mp3_play_data::frame_buf, mp3_play_data::frame_buf_end, mp3_play_data::frame_buf_guard, FS_NAV_ID_AUDIO, FS_SEEK_SET, header(), input, mad_decoder_finish(), mad_decoder_init(), MAD_DECODER_MODE_SYNC, mad_decoder_run(), mad_timer_zero, mp3_play_data::mp3_end_file_pos, MP3_MAX_DATA_REQUESTED, mp3_play_data::mp3_start_file_pos, nav_file_lgt(), nav_select(), NBSAVFILEPOS, output, PCM_BUF_BYTE_SIZE, St_id3size::prepended_tag, reader_id3_size(), time_goal, TimeStampOffset, tSavFilePos, and mp3_play_data::unrecoverable_error.

Referenced by codec_mp3_task().