Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think this is what you are looking for <strong><a href="http://www.fightingquaker.com/myid3/" rel="noreferrer">MyID3 library</a></strong> to set and get tags for media file.</p> <p>Download this jar file <strong><a href="http://sites.google.com/site/eternalsandbox/myid3-for-android" rel="noreferrer">MyID3_for_android</a></strong> and add it to your project's build path. here is the sample code. here <code>pathdata</code> is the file path of the audio file.</p> <pre><code> File src = new File(pathdata); MusicMetadataSet src_set = null; try { src_set = new MyID3().read(src); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } // read metadata if (src_set == null) // perhaps no metadata { Log.i("NULL", "NULL"); } else { try{ IMusicMetadata metadata = src_set.getSimplified(); String artist = metadata.getArtist(); String album = metadata.getAlbum(); String song_title = metadata.getSongTitle(); Number track_number = metadata.getTrackNumber(); Log.i("artist", artist); Log.i("album", album); }catch (Exception e) { e.printStackTrace(); } File dst = new File(pathdata); MusicMetadata meta = new MusicMetadata("name"); meta.setAlbum("Chirag"); meta.setArtist("CS"); try { new MyID3().write(src, dst, src_set, meta); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ID3WriteException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } // write updated metadata } </code></pre> <p>Happy Coding :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload