Android Code Snippet cMediaData

Just putting this code where it really belongs.

Sorry for where I put it to start.

BobVal


I was using MediaBrowser to extract all the information I wanted from a MP3 file, but found it very slow when requesting the information using GetAudioFileInfo passing a filepath / filename. I believe it is quicker using a Meida ID, but I found that for some reason most times after rebooting my Samsung S3 that the Media IDs change so storing them and using them to index became very unreliable for my Music player so I started saving the FilePath / FileName.

To speed things up I wrote a class called cMediaData that can extract all the information and Embedded Pictures
 

Attachments

  • cMediaData.bas
    9.4 KB · Views: 397

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Just some FYI.

Using cMediaData I was getting a lot of null data coming back.

It turns out MediaMetadataRetriever only processes all the data in an MP3 file that is UTF-16

Some of (a lot really) of my MP3s were old and when made for some reason were ISO-8859-1

Using MP3Tag. I made sure the option ID3v2.3 UTF-16 was selected.

upload_2018-1-14_20-46-11.png


And then selected all the MP3 Files that I had that were ISO-8859-1 and save (or resave) them

If you are not sure if you are having this problem. You can create a Column tag in MP3 to show the encoding

upload_2018-1-14_20-51-27.png


upload_2018-1-14_20-52-53.png
 
Top