Page 1 of 1

VS1053 MP3 Shield - ID3 question

Posted: Tue 2020-11-03 13:16
by lmsf
Hi everyone!
I'm doing my first arduino project. It's a pedalboard wich triggers audio files.
I'm using arduino UNO and VS1053 MP3 Shield
I have a 1602 lcd where I want to place the audio files names.
There will be 4 buttons to play samples and 2 more for NEXT and PREVIOUS sounds in the list.
So, I want to have 4 track names in the lcd each time.

The problem is.. The only way that I managed to get the id3 from the track is by playing it first..
I want to find a way to get all 4 names at a given time. Is there a way?
I'm using the NEXT and PREVIOUS buttons to call a function that updates the LCD with the current names. Something like this:

Code: Select all

void UpdateLCD(){
  uint8_t prim = MP3player.playTrack(1); //Play track 1
  char titulo1[30]; // Buffer to store track title
  MP3player.trackTitle((char*)&titulo1); //Get current track title - id3

  lcd.setCursor(0, 0);

Re: VS1053 MP3 Shield - ID3 question

Posted: Wed 2020-11-11 17:15
by lmsf
Anyone knows how to get id3 info without playing the track?

I was looking into this private function, but I'm not getting there by myself :cry: :


void SFEMP3Shield::getTrackInfo (uint8_t offset, char * infobuffer )
- Fetch ID3 Tag information.

[in] offset for the desired information desired.
[out] infobuffer pointer char array of filename to be read.
Read current filehandles offset of track ID3 tag information. Then strip all non readible (ascii) characters.

this suspends currently playing streams and returns afterwards. Restoring the file position to where it left off, before resuming.

Re: VS1053 MP3 Shield - ID3 question

Posted: Thu 2020-11-12 10:39
by pasi
Sorry, I'm not familiar with the mp3 shield. Googling got me to where you are, i.e. found the documentation of the getTrackInfo() function, but not how to open/set the filehandle for it (without playing the file). It would apparently require digging deeper into the library source code.