Package com.jcraft.jorbis

Examples of com.jcraft.jorbis.VorbisFile$SeekableInputStream


            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


      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

TOP

Related Classes of com.jcraft.jorbis.VorbisFile$SeekableInputStream

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.