Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Reading ID3 tags from mp3 stream

I'm streaming an mp3 file using MediaPlayer

mp.setDataSource(myContext, Uri.parse("http://my_song.mp3"));  
mp.prepareAsync();  
mp.setOnPreparedListener(mpOnPreparedListener);  
mp.setOnBufferingUpdateListener(mpOnBufferingUpdateListener);  

Any idea about how I can read the ID3 tags from this stream using android API or any alternative methods?

like image 743
duessi Avatar asked Jan 18 '10 16:01

duessi


People also ask

How do I read an ID3 tag in an MP3 file?

If you want to view and edit ID3 audio or MP3 tags in VLC Media Player, then it has been really made simple. The quickest way to view/edit it is by using the CTRL + I shortcut key on your PC or by navigating to Tools > Media Information.

How do I see ID3 tags?

How do I find my ID3 Tag? Your ID3 tag can be found by first going into iTunes, then selecting a specific song. From here, right click the selected song and select "Get Info". After you have opened this, a dialog box displaying the information will appear.

What is MP3 ID3 tag?

An ID3 tag is a type of metadata container used to store information into a media file (traditionally an MP3 audio file). The ID3 tags could include a title, an album title, the artist (author), genre, cover art, the year recorded and other details that are useful for the listener of your show.

Where are ID3 tags stored?

ID3 tags are metadata stored within MP3 files that contains information such as; the title of the podcast or episode, the artist, and an image artwork for the episode. There are two versions of the ID3 tags. ID3v1 contains only basic, text-only, information and it's placed at the end of the audio file.


1 Answers

You can get all of this using MediaMetadataRetriever

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

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

you can get all other tags by using this class. I hope this would help you.

like image 127
RajSharma Avatar answered Oct 05 '22 02:10

RajSharma