Android Question Read MP3 (Music) info + Image (Thumb)

Douglas Farias

Expert
Licensed User
Hi everyone, I would like to know how I can get the data of a song (title, artist etc .. + image (thumb)) using the latest code options today, something that works on both B4A, B4i and B4J (B4X).

I found some old classes in the forum but are slow, limited or not fully functional, unfortunately I found nothing current and that worked in B4X completely.

i found this example from @Erel in 2011
https://www.b4x.com/android/forum/threads/how-to-read-mp3-id3-tag.11278/#post-63099
but he raised me doubts.

1 - Because it is an old post, I would like to know if today is safe to use this code above, if the above code will not crash in newer versions of android (example android 9)?

2 - Is it possible to get the image (thumb) of a song using this code or similar, if yes how?

To get the image of a music file do you use code similar to the code above or is it something totally different?

Thanks!
 

Syd Wright

Well-Known Member
Licensed User
Data like the Artist's name, Song title, Album title, Year, Thumbnail etc. are stored in the ID3 TAG of an MP3 file. Take a look at the ID3 class: https://www.b4x.com/android/forum/threads/class-id3-reads-tags-and-images-from-mp3-files.21237/ It will get the image (thumbnail) of the song.

If you are using Erel's solution then more info about the ID3 tag can be found here: https://en.wikipedia.org/wiki/ID3

Please note that there are 2 versions: ID3v1 and the more elaborate ID3v2 (with 3 differing subversions). Reading ID3v2 is substantially more difficult.
 
Last edited:
Top