Examples of VorbisFile


Examples of com.jcraft.jorbis.VorbisFile

            inputStream = new BufferedInputStream(new FileInputStream(file));
            inputStream.mark(MARK_LIMIT);
            AudioFileFormat aff = getAudioFileFormat(inputStream);
            inputStream.reset();
            // Get Vorbis file info such as length in seconds.
            VorbisFile vf = new VorbisFile(file.getAbsolutePath());
            return getAudioFileFormat(inputStream, (int) file.length(), (int) Math.round(( vf.time_total(-1) ) * 1000));
        }
        catch (JOrbisException e) {
            throw new IOException(e.getMessage());
        }
        finally {
View Full Code Here

Examples of com.jcraft.jorbis.VorbisFile

      TrackData trackData = track.getTrackData();
        try {
            this.track = track;
            if (trackData.isFile()) {
                logger.fine("Opening file: " + trackData.getFile());
                vorbisFile = new VorbisFile(trackData.getFile().getAbsolutePath());
                streaming = false;
                oldBitrate = trackData.getBitrate();
            } else if (trackData.isStream()) {
                URL url = trackData.getLocation().toURL();
                logger.fine("Opening stream: " + URLDecoder.decode(url.toString(), "utf8"));
                URLConnection urlConnection = url.openConnection();
                String contentType = urlConnection.getContentType();
                if (!contentType.equals("application/ogg")) {
                    logger.warning("Wrong content type: " + contentType);
                    return false;
                }
                InputStream is = urlConnection.getInputStream();
                BufferedInputStream bis = new BufferedInputStream(is);
                vorbisFile = new VorbisFile(bis, null, 0);
                streaming = true;
                reloadComments(track);
                trackData.setCodec("OGG Vorbis Stream");
            }
            Info info = vorbisFile.getInfo()[0];
View Full Code Here

Examples of org.vorbis.jcraft.jorbis.VorbisFile

        try (InputStream inputStream = new BufferedInputStream(new FileInputStream(file))) {
            inputStream.mark(MARK_LIMIT);
            AudioFileFormat aff = getAudioFileFormat(inputStream);
            inputStream.reset();
            // Get Vorbis file info such as length in seconds.
            VorbisFile vf = new VorbisFile(file.getAbsolutePath());
            return getAudioFileFormat(inputStream, (int) file.length(), (int) Math.round((vf.time_total(-1)) * 1000));
        } catch (SoundException e) {
            throw new IOException(e.getMessage());
        }
    }
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.