VS1053 MP3 Shield - ID3 question

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
User avatar
lmsf
User
Posts: 2
Joined: Tue 2020-11-03 13:14

VS1053 MP3 Shield - ID3 question

Post by lmsf » Tue 2020-11-03 13:16

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.clear();
  lcd.setCursor(0, 0);
  lcd.print(titulo1);
}

User avatar
lmsf
User
Posts: 2
Joined: Tue 2020-11-03 13:14

Re: VS1053 MP3 Shield - ID3 question

Post by lmsf » Wed 2020-11-11 17:15

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: :

getTrackInfo()

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

Parameters:
[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.

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

User avatar
pasi
VLSI Staff
Posts: 1730
Joined: Thu 2010-07-15 16:04

Re: VS1053 MP3 Shield - ID3 question

Post by pasi » Thu 2020-11-12 10:39

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.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Post Reply