How can i get information from the file's url?
Eg: if i have the file
char *my_file = /home/user/music.mp3 How can i retrive:
File's title
artist
album
year
file type
You can use libid3tag for the MP3 stuff. Something like:
struct id3_file *id3_file; struct id3_frame const *frame; struct id3_tag *tag; id3_utf8_t *title=NULL; id3_file = id3_file_open (filename, ID3_FILE_MODE_READONLY); if (!id3_file) { // fail return } tag = id3_file_tag (id3_file); if (!tag) { // fail id3_file_close(id3_file); return; } /* get tag values */ frame = id3_tag_findframe (tag, ID3_FRAME_TITLE, 0); if (frame && (field = &frame->fields[1])) { if (id3_field_getnstrings (field) > 0) { title = id3_ucs4_utf8duplicate (id3_field_getstrings (field, 0)); } } /* ... etc ...*/ id3_file_close (id3_file);