Best way to get metadata from Mp3s in Android

I was working on a small media player for Android. I'm having trouble getting metadata from music files. I used MediaMetadataRetriever , but this turned out to be pretty unpleasant. Does anyone know how best to do this? If so, how to implement such a method?

+4
source share
2 answers

I used JAudioTagger , which you can find here . It supports (basically) every version of ID3, so you are covered even for old files with outdated metadata. Pretty good (and simple) solution. Other options include mp3agic and entagged .

+2
source

I managed to read the metadata from the Android database using the code here . Just change managedquery to something like:

 String selection = MediaStore.Audio.Media.DATA + " == ?"; cursor = this.managedQuery(media, projection, selection, new String[] {file.getCanonicalPath().toString()}, null); 

Returns the cursor to the file metadata. (Author, title, duration, etc.)

0
source

Source: https://habr.com/ru/post/1386795/


All Articles