#include <stdio.h>
#include <string.h>
struct {
char cLabel[4];
char cTitle[30];
char cArtist[30];
char cAlbum[30];
char cYear[5];
char cComment[30];
char cGenre;
} id3_tag;
int main (void) {
FILE *ptr;
int offSet = -128;
ptr = fopen("testMP3.mp3", "r");
fseek (ptr, offSet, SEEK_END); // Springen an's Ende der Datei und dann 128 Byte nach vorne
fgets(id3_tag.cLabel, 4, ptr);
offSet = offSet + 3;
fseek (ptr, offSet, SEEK_END);
fgets(id3_tag.cTitle, 30, ptr);
offSet = offSet + 30;
fseek(ptr, offSet, SEEK_END);
fgets(id3_tag.cArtist, 30, ptr);
offSet = offSet + 30;
fseek(ptr, offSet, SEEK_END);
fgets(id3_tag.cAlbum, 30, ptr);
offSet = offSet + 30;
fseek (ptr, offSet, SEEK_END);
fgets(id3_tag.cYear, 5, ptr);
offSet = offSet + 4;
fseek (ptr, offSet, SEEK_END);
fgets(id3_tag.cComment, 30, ptr);
offSet = offSet + 30;
fseek (ptr, offSet, SEEK_END);
id3_tag.cGenre = fgetc(ptr);
fclose (ptr);
printf("Label: %s\n", id3_tag.cLabel);
printf("Title: %s\n", id3_tag.cTitle);
printf("Künstler: %s\n", id3_tag.cArtist);
printf("Album: %s\n", id3_tag.cAlbum);
printf("Jahr: %s\n", id3_tag.cYear);
printf("Kommentar: %s\n", id3_tag.cComment);
printf("Genre: %c\n", id3_tag.cGenre);
}