FileDocCategorySizeDatePackage
LameFrame.javaAPI DocJaudiotagger 2.0.42853Wed Mar 30 16:11:42 BST 2011org.jaudiotagger.audio.mp3

LameFrame

public class LameFrame extends Object
The first frame can sometimes contain a LAME frame at the end of the Xing frame

This useful to the library because it allows the encoder to be identified, full specification can be found at http://gabriel.mp3-tech.org/mp3infotag.html

Summarized here: 4 bytes:LAME 5 bytes:LAME Encoder Version 1 bytes:VNR Method 1 bytes:Lowpass filter value 8 bytes:Replay Gain 1 byte:Encoding Flags 1 byte:minimal byte rate 3 bytes:extra samples 1 byte:Stereo Mode 1 byte:MP3 Gain 2 bytes:Surround Dound 4 bytes:MusicLength 2 bytes:Music CRC 2 bytes:CRC Tag

Fields Summary
public static final int
LAME_HEADER_BUFFER_SIZE
public static final int
ENCODER_SIZE
public static final int
LAME_ID_SIZE
public static final String
LAME_ID
private String
encoder
Constructors Summary
private LameFrame(ByteBuffer lameHeader)
Initilise a Lame Mpeg Frame

param
lameHeader


                
      
    
        encoder = Utils.getString(lameHeader, 0, ENCODER_SIZE, TextEncoding.CHARSET_ISO_8859_1);
    
Methods Summary
public java.lang.StringgetEncoder()

return
encoder

        return encoder;
    
public static org.jaudiotagger.audio.mp3.LameFrameparseLameFrame(java.nio.ByteBuffer bb)
Parse frame

param
bb
return
frame or null if not exists

        ByteBuffer lameHeader = bb.slice();
        String id = Utils.getString(lameHeader, 0, LAME_ID_SIZE, TextEncoding.CHARSET_ISO_8859_1);
        lameHeader.rewind();
        if (id.equals(LAME_ID))
        {
            LameFrame lameFrame = new LameFrame(lameHeader);
            return lameFrame;
        }
        return null;