Package org.kc7bfi.jflac.io

Examples of org.kc7bfi.jflac.io.BitOutputStream


    protected AudioInputStream getAudioInputStream(InputStream inputStream, int medialength) throws UnsupportedAudioFileException, IOException {
        AudioFileFormat audioFileFormat = getAudioFileFormat(inputStream, medialength);

        // push back the StreamInfo
        ByteArrayOutputStream byteOutStream = new ByteArrayOutputStream();
        BitOutputStream bitOutStream = new BitOutputStream(byteOutStream);
        bitOutStream.writeByteBlock(Constants.STREAM_SYNC_STRING, Constants.STREAM_SYNC_STRING.length);
        /**
         * TODO what if StreamInfo not last?
         */
        streamInfo.write(bitOutStream, false);

View Full Code Here


        // get output file
        File outFile = getOutputFile();
        if (outFile == null) {
            return;
        }
        BitOutputStream os = null;
        FileOutputStream fos;
        try {
            fos = new FileOutputStream(outFile);
            os = new BitOutputStream(fos);
        }
        catch (FileNotFoundException e1) {
            e1.printStackTrace();
            return;
        }

        // get seek table
        SeekTable seekTable = makeSeekTable();
        if (masterStreamInfo == null) {
            return;
        }

        // write FLAC marker
        os.writeByteBlock(Constants.STREAM_SYNC_STRING, Constants.STREAM_SYNC_STRING.length);

        // output StreamInfo
        masterStreamInfo.write(os, false);

        // output SeekTable
View Full Code Here

TOP

Related Classes of org.kc7bfi.jflac.io.BitOutputStream

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.