Master Fakhrey
Master Fakhrey

Reputation: 167

How to get audio file info (album, artist, image, ...) Android?

i want to know if i can get mp3 file info like album name, artist, image stored in the mp3 file and more? if there an way to do this please help. by the way: i founded a Java library called Entagged but i can't use it.

Upvotes: 2

Views: 6134

Answers (2)

Master Fakhrey
Master Fakhrey

Reputation: 167

Problem solved by using MediaMetadataRetriever.

MediaMetadataRetriever mediaMetadataRetriever = (MediaMetadataRetriever) new MediaMetadataRetriever();
        Uri uri = (Uri) Uri.fromFile(mp3File);
        mediaMetadataRetriever.setDataSource(MainActivity.this, uri);
        String title = (String) mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE);

Upvotes: 13

syb0rg
syb0rg

Reputation: 8247

jd3lib is a Java library that handles MP3s, and their tags. Probably a useful starting point.

Upvotes: 0

Related Questions