Examples of IAPEDecompress


Examples of davaguine.jmac.decoder.IAPEDecompress

     * @return an APEAudioFileFormat object describing the MAC audio file format
     * @throws UnsupportedAudioFileException - if the stream does not point to valid MAC audio file
     * @throws IOException                   - if an I/O exception occurs
     */
    public AudioFileFormat getAudioFileFormat(InputStream stream, long mediaLength) throws UnsupportedAudioFileException, IOException {
        IAPEDecompress decoder;
        try {
            decoder = IAPEDecompress.CreateIAPEDecompress(new InputStreamFile(stream));
        } catch (JMACException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        } catch (EOFException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        }

        Map fileProperties = new HashMap();
        Map formatProperties = new HashMap();
        APEPropertiesHelper.readProperties(decoder, fileProperties, formatProperties);

        AudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(),
                decoder.getApeInfoBitsPerSample(),
                decoder.getApeInfoChannels(),
                AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false, formatProperties);

        return new APEAudioFileFormat(APEAudioFileFormatType.APE, format, AudioSystem.NOT_SPECIFIED, (int) mediaLength, fileProperties);
    }
View Full Code Here

Examples of davaguine.jmac.decoder.IAPEDecompress

     * @return an APEAudioFileFormat object describing the MAC audio file format
     * @throws UnsupportedAudioFileException - if the File does not point to valid MAC audio file
     * @throws IOException                   - if an I/O exception occurs
     */
    public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
        IAPEDecompress decoder = null;
        davaguine.jmac.tools.File io = new RandomAccessFile(file, "r");
        try {
            decoder = IAPEDecompress.CreateIAPEDecompress(io);
        } catch (JMACException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        } catch (EOFException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        } finally {
            io.close();
        }

        Map fileProperties = new HashMap();
        Map formatProperties = new HashMap();
        APEPropertiesHelper.readProperties(decoder, fileProperties, formatProperties);

        AudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(),
                decoder.getApeInfoBitsPerSample(),
                decoder.getApeInfoChannels(),
                AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false, formatProperties);

        return new APEAudioFileFormat(APEAudioFileFormatType.APE, format, AudioSystem.NOT_SPECIFIED, (int) file.length(), fileProperties);
    }
View Full Code Here

Examples of davaguine.jmac.decoder.IAPEDecompress

     * @throws UnsupportedAudioFileException - if the File does not point to valid MAC audio file
     * @throws IOException                   - if an I/O exception occurs
     */
    public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
        if (Globals.DEBUG) System.out.println("APEAudioFileReader.getAudioFileFormat( File )");
        IAPEDecompress decoder;
        try {
            decoder = IAPEDecompress.CreateIAPEDecompress(new davaguine.jmac.tools.RandomAccessFile(file, "r"));
        } catch (JMACException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        } catch (EOFException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        }

        Map fileProperties = new HashMap();
        Map formatProperties = new HashMap();
        APEPropertiesHelper.readProperties(decoder, fileProperties, formatProperties);

        APEAudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(),
                decoder.getApeInfoBitsPerSample(),
                decoder.getApeInfoChannels(),
                AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false, formatProperties);

        return new APEAudioFileFormat(APEAudioFileFormatType.APE, format, AudioSystem.NOT_SPECIFIED, fileProperties);
    }
View Full Code Here

Examples of davaguine.jmac.decoder.IAPEDecompress

     * @throws UnsupportedAudioFileException - if the stream does not point to valid MAC audio file
     * @throws IOException                   - if an I/O exception occurs
     */
    public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException {
        if (Globals.DEBUG) System.out.println("APEAudioFileReader.getAudioFileFormat( InputStream )");
        IAPEDecompress decoder;
        try {
            decoder = IAPEDecompress.CreateIAPEDecompress(new InputStreamFile(stream));
        } catch (JMACException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        } catch (EOFException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        }

        Map fileProperties = new HashMap();
        Map formatProperties = new HashMap();
        APEPropertiesHelper.readProperties(decoder, fileProperties, formatProperties);

        APEAudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(),
                decoder.getApeInfoBitsPerSample(),
                decoder.getApeInfoChannels(),
                AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false, formatProperties);

        return new APEAudioFileFormat(APEAudioFileFormatType.APE, format, AudioSystem.NOT_SPECIFIED, fileProperties);
    }
View Full Code Here

Examples of davaguine.jmac.decoder.IAPEDecompress

     * @throws UnsupportedAudioFileException - if the File does not point to valid MAC audio file
     * @throws IOException                   - if an I/O exception occurs
     */
    public AudioFileFormat getAudioFileFormat(File file) throws UnsupportedAudioFileException, IOException {
        if (Globals.DEBUG) System.out.println("APEAudioFileReader.getAudioFileFormat( File )");
        IAPEDecompress decoder;
        try {
            decoder = IAPEDecompress.CreateIAPEDecompress(new davaguine.jmac.tools.RandomAccessFile(file, "r"));
        } catch (JMACException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        } catch (EOFException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        }

        APEAudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(),
                decoder.getApeInfoBitsPerSample(),
                decoder.getApeInfoChannels(),
                AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false);

        return new APEAudioFileFormat(APEAudioFileFormatType.APE, (int) file.length(), format, AudioSystem.NOT_SPECIFIED);
    }
View Full Code Here

Examples of davaguine.jmac.decoder.IAPEDecompress

     * @throws UnsupportedAudioFileException - if the stream does not point to valid MAC audio file
     * @throws IOException                   - if an I/O exception occurs
     */
    public AudioFileFormat getAudioFileFormat(InputStream stream) throws UnsupportedAudioFileException, IOException {
        if (Globals.DEBUG) System.out.println("APEAudioFileReader.getAudioFileFormat( InputStream )");
        IAPEDecompress decoder;
        try {
            decoder = IAPEDecompress.CreateIAPEDecompress(new InputStreamFile(stream));
        } catch (JMACException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        } catch (EOFException e) {
            throw new UnsupportedAudioFileException("Unsupported audio file");
        }

        APEAudioFormat format = new APEAudioFormat(APEEncoding.APE, decoder.getApeInfoSampleRate(),
                decoder.getApeInfoBitsPerSample(),
                decoder.getApeInfoChannels(),
                AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, false);

        return new APEAudioFileFormat(APEAudioFileFormatType.APE, AudioSystem.NOT_SPECIFIED, format, AudioSystem.NOT_SPECIFIED);
    }
View Full Code Here

Examples of davaguine.jmac.decoder.IAPEDecompress

        fmt = fmt0;
    }

    protected AudioFormat getAudioFormat() {
        if (fmt == null) {
            IAPEDecompress decoder = getDecoder();
            fmt = new AudioFormat(decoder.getApeInfoSampleRate(),
                    decoder.getApeInfoBitsPerSample(),
                    decoder.getApeInfoChannels(),
                    true,
                    false);
        }
        return fmt;
    }
View Full Code Here

Examples of davaguine.jmac.decoder.IAPEDecompress

        if (pInputFilename == null)
            throw new JMACException("Bad Parameters");

        // see if we can quick verify
        File file = File.createFile(pInputFilename, "r");
        IAPEDecompress spAPEDecompress = null;
        try {
            spAPEDecompress = IAPEDecompress.CreateIAPEDecompress(file);

            APEFileInfo pInfo = spAPEDecompress.getApeInfoInternalInfo();

            if ((pInfo.nVersion < 3980) || (pInfo.spAPEDescriptor == null))
                DecompressCore(spAPEDecompress, null, UNMAC_DECODER_OUTPUT_NONE, -1, progressor);
            else {
                MD5 MD5Helper = new MD5();

                File pIO = spAPEDecompress.getApeInfoIoSource();

                int nHead = (int) (pInfo.nJunkHeaderBytes + pInfo.spAPEDescriptor.nDescriptorBytes);
                int nStart = (int) (nHead + pInfo.spAPEDescriptor.nHeaderBytes + pInfo.spAPEDescriptor.nSeekTableBytes);

                pIO.seek(nHead);
View Full Code Here

Examples of davaguine.jmac.decoder.IAPEDecompress

        // error check the function parameters
        if (pInputFilename == null)
            throw new JMACException("Bad Parameters");

        // variable declares
        IAPEDecompress spAPEDecompress = null;
        File file = File.createFile(pInputFilename, "r");
        try {
            spAPEDecompress = IAPEDecompress.CreateIAPEDecompress(file);
            DecompressCore(spAPEDecompress, pOutputFilename, nOutputMode, nCompressionLevel, progressor);
        } finally {
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.