Results 1 to 6 of 6

Thread: Java Library for pulling album artwork from mp3

  1. #1
    Join Date
    Sep 2011
    Location
    South Africa
    Beans
    165
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Java Library for pulling album artwork from mp3

    Hi

    I'm making an mp3 player in Java.

    I need a small library to pull album artwork from the mp3 file.
    Can you please suggest one

    Regards

  2. #2
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,165
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Java Library for pulling album artwork from mp3

    Quote Originally Posted by 3v3rgr33n View Post
    Hi

    I'm making an mp3 player in Java.

    I need a small library to pull album artwork from the mp3 file.
    Can you please suggest one

    Regards
    The artwork in the MP3 is coded as an ID3v2 tag, so if you can display the rest you have a library that already supports that. Otherwise have a look at: http://javamusictag.sourceforge.net/

  3. #3
    Join Date
    Jun 2011
    Location
    Paris
    Beans
    55

    Re: Java Library for pulling album artwork from mp3

    http://mvnrepository.com/artifact/or...iotagger/2.0.3

    It looks like this library can read/write tags on mp3s and other formats. It also has a mvn repo for your gradle/sbt/maven needs.

  4. #4
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: Java Library for pulling album artwork from mp3

    Jaudiotagger fully supports Mp3, Mp4 (Mp4 audio, M4a and M4p audio) Ogg Vorbis, Flac and Wma, there is limited support for Wav and Real formats.
    Please mark your thread as solved if you get a satisfactory response
    PopularPages - A Ubuntu Documentation Search Tool
    Ubuntu membership via Forums contributions

  5. #5
    Join Date
    Sep 2011
    Location
    South Africa
    Beans
    165
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Java Library for pulling album artwork from mp3

    Quote Originally Posted by ofnuts View Post
    The artwork in the MP3 is coded as an ID3v2 tag, so if you can display the rest you have a library that already supports that. Otherwise have a look at: http://javamusictag.sourceforge.net/
    I decided to use your suggestion, I tested the library by getting the album name and stuff --- it works!

    You were sayin' the artwork is coded as an ID3v2 tag ryt?
    I created an MP3File object:
    Code:
    MP3File song = new MP3File(new File(someMedia.getPath()));
    The problem now is getting the actual picture, I've been looking at http://javamusictag.sourceforge.net/api/index.html ,I don't know which method to use for getting the picture in the AbstractID3v2 class. Please help
    Last edited by 3v3rgr33n; February 6th, 2013 at 12:49 PM.

  6. #6
    Join Date
    Sep 2011
    Location
    South Africa
    Beans
    165
    Distro
    Xubuntu 12.10 Quantal Quetzal

    Re: Java Library for pulling album artwork from mp3

    Nvm. I ended up using https://github.com/mpatric/mp3agic

    It's easier to use it.

    Here's a sample of my code.
    Code:
    Mp3File song = new Mp3File(someMedia.getPath());
                    if (song.hasId3v2Tag()){
                        ID3v2 id3v2tag = song.getId3v2Tag();
                        byte[] imageData = id3v2tag.getAlbumImage();
                        if (imageData!=null){
                            System.out.println("debug:: imageData is not null");
                            BufferedImage img = ImageIO.read(new ByteArrayInputStream(imageData));
                            ImageIcon icon = new ImageIcon(img);
                            label.setIcon(icon);
                        }
                    }
    Thnks guys!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •