Go Down

Topic: SFEMP3Shield library issue (playMP3 command) (Read 50 times) previous topic - next topic

Yannpix

Hello everybody,
Yet another newbie question :-)

Here is my setting : Arduino uno + VS1053 MP3 shield from Geeetech.
I'm using the MP3Shield Arduino library from Bill Porter

Everything works well until I want to use a special feature of the playMP3 command.
As explained in the library, the format is: uint8_t SFEMP3Shield::playMP3 (char * fileName,uint32_t timecode = 0)

In my comprehension, the timecode could be used to start playing a particular track with an offset (in ms) which would be very useful for my application.
I did a lot of test but I'm still unable to make it works…  Am I in the wrong way ?

My needs are the following:
Playing an MP3 file (the main theme) which can be interrupted by events where I would play other short sounds, then back to the main theme at the previous location of the reading.

Any help would be greatly appreciated !


Description of the function: playMP3 (char * fileName,uint32_t timecode = 0)

Begin playing a mp3 file by its filename.
Parameters
[out]   fileName   pointer of a char array (aka string), containing the filename
[in]   timecode   (optional) milliseconds from the beginning of the file. Only works with mp3 files, otherwise do nothing.
Skip, if already playing. Otherwise initialize the SdCard track to desired filehandle. Reset the ByteRate and Play position and set playing to indicate such. If the filename extension is MP3, then pre-read the byterate from the file. And initially fill the VSDsp's buffer, then enable refilling.

Returns
Any Value other than zero indicates a problem occured. where value indicates specific error
See also
Error Codes
Note
Currently bitrate to calculate time offset is determined by either playing files or by reading MP3 headers. Hence only the later is doable without actually playing files. Hence other formats are not available, yet.
enableRefill() will enable the appropiate interrupt to match the corresponding means selected.
use SdFat::chvol() command prior, to select desired SdCard volume, if multiple cards are used.

Go Up