4 Replies Latest reply: May 1, 2014 8:12 AM by gimbal2 RSS

    edit custom genre problem[Java]

    ad0bc99c-21b5-425e-a562-edddc95593f5

      I am trying to edit the custom genre of mp3 files like "Welcome" using mp3agic library but it is not working.

       

      https://github.com/mpatric/mp3agic

       

      Mp3Filemp3file=newMp3File("SomeMp3File.mp3");

      if (mp3file.hasId3v2Tag()) {

        ID3v2 id3v2Tag = mp3file.getId3v2Tag();

        System.out.println("Track: " + id3v2Tag.getTrack());

        System.out.println("Artist: " + id3v2Tag.getArtist());

        System.out.println("Title: " + id3v2Tag.getTitle());

        System.out.println("Album: " + id3v2Tag.getAlbum());

        System.out.println("Year: " + id3v2Tag.getYear());

        System.out.println("Genre: " + id3v2Tag.getGenre() + " (" + id3v2Tag.getGenreDescription() + ")");

        System.out.println("Comment: " + id3v2Tag.getComment());

        System.out.println("Composer: " + id3v2Tag.getComposer());

        System.out.println("Publisher: " + id3v2Tag.getPublisher());

        System.out.println("Original artist: " + id3v2Tag.getOriginalArtist());

        System.out.println("Album artist: " + id3v2Tag.getAlbumArtist());

        System.out.println("Copyright: " + id3v2Tag.getCopyright());

        System.out.println("URL: " + id3v2Tag.getUrl());

        System.out.println("Encoder: " + id3v2Tag.getEncoder());

        byte[] albumImageData = id3v2Tag.getAlbumImage();

        if (albumImageData != null) {

         System.out.println("Have album image data, length: " + albumImageData.length + " bytes");

         System.out.println("Album image mime type: " + id3v2Tag.getAlbumImageMimeType());

        }

      }


      I can edit album, artist,track, etc but cannot add custom genre. How can i do that?

       

      Thanks