Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract metadata from mp3?

Tags:

android

mp3

I've got file name of mp3 file. How can I extract metadata like artist, album, album image,... from this mp3 file?

like image 414
Ido Magor Avatar asked Jul 04 '12 11:07

Ido Magor


People also ask

How do I get metadata from audio files?

There are a number of programs you can use to track down missing metadata. We recommend looking at programs like Media Monkey, Audacity and JRiver which allow you to search their database for the correct info and simply drag and drop in the album artwork you're missing.

Can you extract metadata?

ExifTool is a powerful tool used to extract metadata of a file. It is used not only on images but some other formats of files like PDF and mp4 etc. It enables us to update and remove metadata of files and gives a lot of information about files.

Do MP3 files contain metadata?

ID3 is a metadata container most often used in conjunction with the MP3 audio file format. It allows information such as the title, artist, album, track number, and other information about the file to be stored in the file itself.


1 Answers

try this for API level 10 or greater

 MediaMetadataRetriever mmr = new MediaMetadataRetriever();
 mmr.setDataSource(filePath);

String albumName = mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM));

and so on...

for more help

like image 52
Mohsin Naeem Avatar answered Sep 23 '22 18:09

Mohsin Naeem