org.jaudiotagger.audio.mp3
Class XingFrame

java.lang.Object
  extended by org.jaudiotagger.audio.mp3.XingFrame

public class XingFrame
extends java.lang.Object

Xing Frame

In some MP3s which variable bit rate the first frame in the file contains a special frame called a Xing Frame, instead of audio data. This is used to store additional information about the file. The most important aspect for this library is details allowing us to determine the bitrate of a Variable Bit Rate VBR file without having to process the whole file. Xing VBR Tag data format is 120 bytes long 4 bytes for Header Tag 4 bytes for Header Flags 4 bytes for FRAME SIZE 4 bytes for AUDIO_SIZE 100 bytes for entry (NUMTOCENTRIES) 4 bytes for VBR SCALE. a VBR quality indicator: 0=best 100=worst It my then contain a Lame Frame ( a Lame frame is in essence an extended Xing Frame


Field Summary
static int MAX_BUFFER_SIZE_NEEDED_TO_READ_XING
           
 
Method Summary
 int getAudioSize()
           
 int getFrameCount()
           
 LameFrame getLameFrame()
           
 boolean isAudioSizeEnabled()
           
 boolean isFrameCountEnabled()
           
 boolean isVbr()
          Is this XingFrame detailing a varaible bit rate MPEG
static boolean isXingFrame(java.nio.ByteBuffer bb, MPEGFrameHeader mpegFrameHeader)
          IS this a Xing frame
static XingFrame parseXingFrame()
          Parse the XingFrame of an MP3File, cannot be called until we have validated that this is a XingFrame
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_BUFFER_SIZE_NEEDED_TO_READ_XING

public static final int MAX_BUFFER_SIZE_NEEDED_TO_READ_XING
See Also:
Constant Field Values
Method Detail

getLameFrame

public LameFrame getLameFrame()

isFrameCountEnabled

public final boolean isFrameCountEnabled()
Returns:
true if frameCount has been specified in header

getFrameCount

public final int getFrameCount()
Returns:
count of frames

isAudioSizeEnabled

public final boolean isAudioSizeEnabled()
Returns:
true if audioSize has been specified in header

getAudioSize

public final int getAudioSize()
Returns:
size of audio data in bytes

parseXingFrame

public static XingFrame parseXingFrame()
                                throws InvalidAudioFrameException
Parse the XingFrame of an MP3File, cannot be called until we have validated that this is a XingFrame

Returns:
Throws:
InvalidAudioFrameException

isXingFrame

public static boolean isXingFrame(java.nio.ByteBuffer bb,
                                  MPEGFrameHeader mpegFrameHeader)
IS this a Xing frame

Returns:
true if this is a Xing frame

isVbr

public final boolean isVbr()
Is this XingFrame detailing a varaible bit rate MPEG

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a string represntation