Examples of MP3File


Examples of com.dotmarketing.portlets.files.model.MP3File

      for (File file : mp3Files) {
        // only show live files
        if (!file.isLive()) {
          continue;
        }
        MP3File mp3 = new MP3File(file);

        sw.write("<track>\n");
        sw.write("<location>http://" + host.getHostname() + APILocator.getIdentifierAPI().find(folder).getPath() + file.getFileName()
            + "</location>\n");

        if (UtilMethods.isSet(mp3.getArtist())) {
          sw.write("<creator>" + XMLUtils.xmlEscape(mp3.getArtist()) + "</creator>\n");
        }
        if (UtilMethods.isSet(mp3.getAlbum())) {
          sw.write("<album>" + XMLUtils.xmlEscape(mp3.getAlbum()) + "</album>\n");
        }

        if (UtilMethods.isSet(mp3.getTitle())) {
          sw.write("<title>" + XMLUtils.xmlEscape(mp3.getTitle()) + "</title>\n");
        }
        if (UtilMethods.isSet(mp3.getGenre())) {
          sw.write("<genre>" + XMLUtils.xmlEscape(mp3.getGenre()) + "</genre>\n");
        }

        if (mp3.getDuration() > 0) {
          sw.write("<duration>" + mp3.getDuration() + "</duration>\n");
        }
        sw.write("<image>http://" + host.getHostname() + "/global/images/mp3logo.jpg</image>\n");

        sw.write("</track>\n");
View Full Code Here

Examples of com.mpatric.mp3agic.Mp3File

  private Logger logger = LoggerFactory.getLogger(MP3FileExtractor.class);
 
  @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

Examples of com.mpatric.mp3agic.Mp3File

                    is.close();
                }
            }

            // Remove id3v1 tag
            Mp3File mp3File = new Mp3File(tempFile.getAbsolutePath());
            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) {
                    if (err != null) {
                        e.initCause(err);
                        throw e;
View Full Code Here

Examples of com.mpatric.mp3agic.Mp3File

     * Find the song ID associated with a file.
     *
     * @return The song ID, or {@link #ID_NONE}.
     */
    public static int decodeId(File file) {
        Mp3File mp3File;
        try {
            mp3File = new Mp3File(file.getAbsolutePath());
            if (mp3File.hasId3v2Tag()) {
                String encoder = mp3File.getId3v2Tag().getEncoder();
                if (encoder != null) {
                    Matcher matcher = ID_PATTERN.matcher(encoder);
                    if (matcher.matches()) {
                        return Integer.parseInt(matcher.group(1));
                    }
View Full Code Here

Examples of com.mpatric.mp3agic.Mp3File

                    is.close();
                }
            }

            // Remove id3v1 tag
            Mp3File mp3File = new Mp3File(tempFile.getAbsolutePath());
            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) {
                    if (err != null) {
                        e.initCause(err);
                        throw e;
View Full Code Here

Examples of dnb.data.filetree.Mp3File

      reporter.fileFolder(cur);
    }   
    Path fil = name.getName(li);
    if (fil.toString().toLowerCase().endsWith(".mp3")) {
      mp3FileCount++;     
      Mp3File f = new Mp3File(fil.toString(), attrs.size());
      cur.add(f);
      reporter.file(f);
    } else {
      nfoFileCount++;
      NfoFile f = new NfoFile(fil.toString(), attrs.size());
View Full Code Here

Examples of helliker.id3.MP3File

    public void display()
    {
  clear();

  try {
      MP3File m = new MP3File(getFile());
     
      jtAlbum.setText(m.getAlbum());
      jtArtist.setText(m.getArtist());
      jtTitle.setText(m.getTitle());
      jtYear.setText(m.getYear());
      jtComment.setText(m.getComment());

      // why call getFile().canRead()? an IOException should have
      // occured if we could not read the file
      setEnabled(getFile().canWrite());
  }
View Full Code Here

Examples of helliker.id3.MP3File

     * Writes id3 tags to file.
     */
    protected void save()
    {
  try {
      MP3File m = new MP3File(getFile());

      m.setTitle(jtTitle.getText());
      m.setArtist(jtArtist.getText());
      m.setAlbum(jtAlbum.getText());
      m.setYear(jtYear.getText());
      m.setComment(jtComment.getText());

      m.writeTags();

      setStatus(XNap.tr("Changes successfully saved."));
  }
  catch (Exception e) {
      setStatus(XNap.tr("Could not write ID Tags to file"));
View Full Code Here

Examples of org.blinkenlights.jid3.MP3File

    this.fileName = file.getName();
    File sub = oneUp(file);
    this.subDirectory = sub.getName();
    this.rootDirectory = oneUp(sub).getName();

    MP3File mp3File = new MP3File(file);
    try {
      tag1 = mp3File.getID3V1Tag();
      if(tag1==null){
        tag1 = new ID3V1_0Tag();
      }
    } catch (ID3Exception e) {
      tag1 = new ID3V1_0Tag();
View Full Code Here

Examples of org.blinkenlights.jid3.MP3File

    return nullGuard(parameters.get("full"));

  }

  public void persist(String directory) {
    MP3File mp3File = new MP3File(new File(directory + getFull()));
    ID3V1Tag tag1 = null;
    try {
      tag1 = mp3File.getID3V1Tag();
      if(tag1==null){
        tag1 = new ID3V1_0Tag();
      }
    } catch (ID3Exception e) {
      tag1 = new ID3V1_0Tag();
    }
    if(!"".equals(getTitle())) tag1.setTitle(getTitle());
    tag1.setAlbum(getAlbum());
    tag1.setArtist(getArtist());
    tag1.setComment(getComment());
    try {
      tag1.setGenre(Genre.lookupGenre(getGenre()));
    } catch (ID3Exception e) {
    }
    tag1.setYear(getYear());
    mp3File.setID3Tag(tag1);
    try {
      mp3File.sync();
    } catch (ID3Exception e) {
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.