Package org.jaudiotagger.audio.exceptions

Examples of org.jaudiotagger.audio.exceptions.InvalidAudioFrameException


    private void setVersion() throws InvalidAudioFrameException {
        //MPEG Version
        version = (byte) ((mpegBytes[BYTE_2] & MASK_MP3_VERSION) >> 3);
        versionAsString = mpegVersionMap.get(version);
        if (versionAsString == null) {
            throw new InvalidAudioFrameException("Invalid mpeg version");
        }
    }
View Full Code Here


        /* BitRate, get by checking header setBitrate bits and MPEG Version and Layer */
        int bitRateIndex = mpegBytes[BYTE_3] & MASK_MP3_BITRATE | mpegBytes[BYTE_2] & MASK_MP3_ID | mpegBytes[BYTE_2] & MASK_MP3_LAYER;

        bitRate = bitrateMap.get(bitRateIndex);
        if (bitRate == null) {
            throw new InvalidAudioFrameException("Invalid bitrate");
        }
    }
View Full Code Here

     */
    private void setChannelMode() throws InvalidAudioFrameException {
        channelMode = (mpegBytes[BYTE_4] & MASK_MP3_MODE) >>> 6;
        channelModeAsString = modeMap.get(channelMode);
        if (channelModeAsString == null) {
            throw new InvalidAudioFrameException("Invalid channel mode");
        }
    }
View Full Code Here

     */
    private void setEmphasis() throws InvalidAudioFrameException {
        emphasis = mpegBytes[BYTE_4] & MASK_MP3_EMPHASIS;
        emphasisAsString = emphasisMap.get(emphasis);
        if (getEmphasisAsString() == null) {
            throw new InvalidAudioFrameException("Invalid emphasis");
        }
    }
View Full Code Here

     */
    private void setLayer() throws InvalidAudioFrameException {
        layer = (mpegBytes[BYTE_2] & MASK_MP3_LAYER) >>> 1;
        layerAsString = mpegLayerMap.get(layer);
        if (layerAsString == null) {
            throw new InvalidAudioFrameException("Invalid Layer");
        }
    }
View Full Code Here

    private void setModeExtension() throws InvalidAudioFrameException {
        int index = (mpegBytes[BYTE_4] & MASK_MP3_MODE_EXTENSION) >> 4;
        if (layer == LAYER_III) {
            modeExtension = modeExtensionLayerIIIMap.get(index);
            if (getModeExtension() == null) {
                throw new InvalidAudioFrameException("Invalid Mode Extension");
            }
        } else {
            modeExtension = modeExtensionMap.get(index);
            if (getModeExtension() == null) {
                throw new InvalidAudioFrameException("Invalid Mode Extension");
            }
        }
    }
View Full Code Here

    private void setSamplingRate() throws InvalidAudioFrameException {
        //Frequency
        int index = (mpegBytes[BYTE_3] & MASK_MP3_FREQUENCY) >>> 2;
        Map<Integer, Integer> samplingRateMapForVersion = samplingRateMap.get(version);
        if (samplingRateMapForVersion == null) {
            throw new InvalidAudioFrameException("Invalid version");
        }
        samplingRate = samplingRateMapForVersion.get(index);
        if (samplingRate == null) {
            throw new InvalidAudioFrameException("Invalid sampling rate");
        }
    }
View Full Code Here

     * @throws IOException
     * @throws InvalidAudioFrameException
     */
    public MP3AudioHeader(final File seekFile) throws IOException, InvalidAudioFrameException {
        if (!seek(seekFile, 0)) {
            throw new InvalidAudioFrameException("No audio header found within" + seekFile.getName());
        }
    }
View Full Code Here

     * @throws IOException
     * @throws InvalidAudioFrameException
     */
    public MP3AudioHeader(final File seekFile, long startByte) throws IOException, InvalidAudioFrameException {
        if (!seek(seekFile, startByte)) {
            throw new InvalidAudioFrameException("No audio header found within" + seekFile.getName());
        }
    }
View Full Code Here

TOP

Related Classes of org.jaudiotagger.audio.exceptions.InvalidAudioFrameException

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.