Kace
Kace

Reputation: 43

Android MediaMetadataRetriever extracting genre bad format

i'm having a problem with MediaMetadataRetriever when extracting GENRE meta data from a mp3 file.

    MediaMetadataRetriever metadata = new MediaMetadataRetriever();
    String path = file.getPath();
    metadata.setDataSource(path);
    String album = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM);
    Log.v("METADATA->", "Album: " + album);
    String artist = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST);
    Log.v("METADATA->", "Artist: " + artist);
    String genre = metadata.extractMetadata(MediaMetadataRetriever.METADATA_KEY_GENRE);
    Log.v("METADATA->", "Genre: " + genre);

Everything is working OK but GENRE isn't...

In a mp3 file where GENRE is 'Rap' i get from log:

V/METADATA->: Genre: (15)

In a mp3 file where GENRE is 'Hip-Hop' i get from log:

V/METADATA->: Genre: (7)

Solved!

Upvotes: 1

Views: 394

Answers (1)

Kace
Kace

Reputation: 43

Nevermind, searching for a while in Google i went to this web and realized why my genre was a "number". Genre metadata is stored in one unique byte and i found a list os genres ordered by it's byte value: ID3v1 genre list.

Upvotes: 2

Related Questions