P
P
Paul Fawkes2019-05-12 21:48:49
MP3
Paul Fawkes, 2019-05-12 21:48:49

Link to artist soundcloud profile from javafx player?

I read mp3 tags and want to go to the soundcloud page by artist, how can I implement this?

public  void readFiles(File baseDirectory) {


        try {

            Iterator<File> iterator = FileUtils.iterateFiles(baseDirectory, new String[]{"mp3"}, true);
            while (iterator.hasNext()) {


                fileloop = iterator.next();


                InputStream input = new FileInputStream(fileloop);
                InputStream input2 = new FileInputStream(fileloop);
                BodyContentHandler handler = new BodyContentHandler();
                Metadata metadata = new Metadata();
                Mp3Parser parser = new Mp3Parser();
                ParseContext parseCtx = new ParseContext();
                String digest = DigestUtils.md5Hex(input2);
                parser.parse(input, handler, metadata, parseCtx);

                input.close();

                Mp3data track = new Mp3data();

                track.setArtist(metadata.get("xmpDM:artist"));
                track.setAlbum(metadata.get("xmpDM:album"));
                track.setTitle(metadata.get("title"));
                track.setDuration(toMinutes(metadata.get("xmpDM:duration")));
                track.setPath(fileloop.getAbsolutePath());
                track.setHashCode(digest);

                mp3data.add(track);
                mediafile = new Media(fileloop.toURI().toString());
                mp3files.add(mediafile);


            }
            Collections.sort(mp3data);
        } catch (IOException | SAXException | TikaException e) {
            e.printStackTrace();
        }

    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question