Package com.totalchange.jizz.audio

Examples of com.totalchange.jizz.audio.JizzTrackAudioFormat


        songs.offer(song);
    }

    @Override
    public JizzTrackAudioFormat getFormat() {
        JizzTrackAudioFormat format = new JizzTrackAudioFormat();
        format.setBitRate(190);
        format.setFormat(JizzTrackAudioFormat.Format.MP3);

        return format;
    }
View Full Code Here


        // Will need to fetch the songs that make up the broadcast and turn them
        // into sources. The first song will dictate the format of the entire
        // broadcast until at a later date add support for multiple formats.
        List<JizzSong> songs = jizzSongServices.getSongsForBroadcast(broadcast);

        JizzTrackAudioFormat format;
        if (songs.size() > 0) {
            JizzSong firstSong = songs.get(0);

            Iterator<JizzSongEncoding> encodings = firstSong.getEncodings()
                    .iterator();
            if (!encodings.hasNext()) {
                throw new RuntimeException("Song has no encodings");
            }

            JizzSongEncoding encoding = encodings.next();
            format = new JizzTrackAudioFormat();
            format.setFormat(JizzTrackAudioFormat.Format.valueOf(encoding
                    .getFormat()));
            format.setBitRate(encoding.getBitRateKbps());
        } else {
            // No songs? No format needed then. Will be a short broadcast :-(
            format = null;
        }
View Full Code Here

        JizzBlobReader masterBlob = jizzBlobServices.retrieveBlob(station,
                song.getMasterBlobRef());
        JizzBlobWriter encodedBlob = jizzBlobServices.createBlob(station);

        JizzTrackAudioFormat format = new JizzTrackAudioFormat();
        format.setFormat(JizzTrackAudioFormat.Format.MP3);
        format.setBitRate(DEFAULT_BIT_RATE);

        try {
            logger.trace("Doing transcoding");
            song.setLength(jizzTrackServices.transcode(format, masterBlob,
                    encodedBlob));
        } catch (Throwable th) {
            logger.info("Failed to transcode song " + song + ", deleting it",
                    th);
            jizzEmailServices.sendUnsupportedSongTypeEmail(song.getDj(), song);

            deleteSong(station, song);
            return null;
        }

        logger.trace("Transcoded, committing encoded blob");
        String encodedBlobRef = encodedBlob.commit();

        JizzSongEncoding encoding = new JizzSongEncoding();
        encoding.setFormat(format.getFormat().name());
        encoding.setBitRateKbps(format.getBitRate());
        encoding.setBlobRef(encodedBlobRef);

        Set<JizzSongEncoding> encodings = new HashSet<>(1);
        encodings.add(encoding);
        song.setEncodings(encodings);
View Full Code Here

    @Test
    public void testEncode() throws UnsupportedTrackTypeException, IOException {
        JizzJump3rTrackAudioWriterImpl writer = new JizzJump3rTrackAudioWriterImpl();
        InputStream in = JizzAudioTests.getRawTest();

        JizzTrackAudioFormat format = new JizzTrackAudioFormat();
        format.setFormat(JizzTrackAudioFormat.Format.MP3);
        format.setBitRate(128);

        InputStream encoded = writer.encode(format, in);
        OutputStream out = new BufferedOutputStream(new FileOutputStream(
                makeTestOutFile("test-2-44100-s16-mp3-128.mp3")));
View Full Code Here

TOP

Related Classes of com.totalchange.jizz.audio.JizzTrackAudioFormat

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.