Show Artist and Title Question #351
-
It's a wonderful library. Thank you @schreibfaul1 for the effort. Could it be possible for you to show me how to grab artist and title only from void audio_id3data(const char *info)? That prints a lot of ID3 tag information, such as Track, PartOfSet, Title, Album, ContentType, Year, Artist, Band and Composer, I only need artist and title only. Thanks for any help, I appreciate it. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Hello inovaxt, |
Beta Was this translation helpful? Give feedback.
-
Thank you @schreibfaul1 for the reply, I will study the showID3Tag & deactivate the tags and how to concatenate char* and char* into a char*. |
Beta Was this translation helpful? Give feedback.
-
this simple code works as long as there is an artist and title tag void audio_id3data(const char *info){
String tmp = info;
static String artist = "";
static String title = "";
if(tmp.startsWith("Artist:")) artist = tmp.substring(8);
if(tmp.startsWith("Title:")) title = tmp.substring(7);
if(artist.length() > 0 && title.length() > 0){
tmp = artist + " - " + title;
Serial.println(tmp);
artist = "";
title = "";
}
} |
Beta Was this translation helpful? Give feedback.
Hello inovaxt,
the ID3 tags are all evaluated if they are present. In the routine showID3Tag you can deactivate the tags that are of no interest to you. There are different tags in the ID3 versions, with V2.2 only rarely being found