Package com.mpatric.mp3agic

Examples of com.mpatric.mp3agic.ID3v2


  @Override
  protected void performExtraction(URI arg0, File arg1, Charset arg2, String arg3, RDFContainer result) throws ExtractorException {
    try {
      Mp3File mp3File = new Mp3File(arg1.toString());
      ID3v1 id3v1 = mp3File.getId3v1Tag();
      ID3v2 id3v2 = mp3File.getId3v2Tag();
      ID3Wrapper wrapper = new ID3Wrapper(id3v1,id3v2);
      addId3Fields(wrapper,result);
      result.add(RDF.type, NID3.ID3Audio);
     
    } catch (UnsupportedTagException e) {
View Full Code Here


            if (mp3File.hasId3v1Tag()) {
                mp3File.removeId3v1Tag();
            }

            // Get/create id3v2 tag
            ID3v2 id3v2Tag;
            if (mp3File.hasId3v2Tag()) {
                id3v2Tag = mp3File.getId3v2Tag();
            } else {
                id3v2Tag = new ID3v23Tag();
            }
            Exception err = null;
            while (true) {
                // Try saving twice; once with old tag data, and again after
                // discarding corrupt data and starting over
                try {
                    id3v2Tag.setTitle(song.getName());
                    id3v2Tag.setArtist(song.getArtistName());
                    id3v2Tag.setAlbum(song.getAlbumName());
                    id3v2Tag.setYear(song.getYear() + "");
                    Utils.encodeId(song.getId(), id3v2Tag);
                    mp3File.setId3v2Tag(id3v2Tag);
                    mp3File.save(tempFile2.getAbsolutePath());
                    break;
                } catch (NotSupportedException e) {
View Full Code Here

            if (mp3File.hasId3v1Tag()) {
                mp3File.removeId3v1Tag();
            }

            // Get/create id3v2 tag
            ID3v2 id3v2Tag;
            if (mp3File.hasId3v2Tag()) {
                id3v2Tag = mp3File.getId3v2Tag();
            } else {
                id3v2Tag = new ID3v23Tag();
            }
            Exception err = null;
            while (true) {
                // Try saving twice; once with old tag data, and again after
                // discarding corrupt data and starting over
                try {
                    id3v2Tag.setTitle(song.getName());
                    id3v2Tag.setArtist(song.getArtistName());
                    id3v2Tag.setAlbum(song.getAlbumName());
                    id3v2Tag.setYear(song.getYear() + "");
                    Utils.encodeId(song.getId(), id3v2Tag);
                    mp3File.setId3v2Tag(id3v2Tag);
                    mp3File.save(tempFile2.getAbsolutePath());
                    break;
                } catch (NotSupportedException e) {
View Full Code Here

TOP

Related Classes of com.mpatric.mp3agic.ID3v2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.