public class XingFrame
extends java.lang.Object
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 FrameModifier and Type | Field and Description |
---|---|
private int |
audioSize |
private static int |
BYTE_1 |
private static int |
BYTE_2 |
private static int |
BYTE_3 |
private static int |
BYTE_4 |
private int |
frameCount |
private java.nio.ByteBuffer |
header |
private boolean |
isAudioSizeEnabled |
private boolean |
isFrameCountEnabled |
private LameFrame |
lameFrame |
static int |
MAX_BUFFER_SIZE_NEEDED_TO_READ_XING |
private static int |
MPEG_VERSION_1_MODE_MONO_OFFSET |
private static int |
MPEG_VERSION_1_MODE_STEREO_OFFSET |
private static int |
MPEG_VERSION_2_MODE_MONO_OFFSET |
private static int |
MPEG_VERSION_2_MODE_STEREO_OFFSET |
private boolean |
vbr |
private static int |
XING_AUDIOSIZE_BUFFER_SIZE |
private static byte[] |
XING_CBR_ID
Use when it is a CBR (Constant Bitrate) file
|
private static int |
XING_FLAG_BUFFER_SIZE |
private static int |
XING_FRAMECOUNT_BUFFER_SIZE |
private static int |
XING_HEADER_BUFFER_SIZE |
private static int |
XING_IDENTIFIER_BUFFER_SIZE |
private static byte[] |
XING_VBR_ID
Use when it is a VBR (Variable Bitrate) file
|
Modifier | Constructor and Description |
---|---|
private |
XingFrame(java.nio.ByteBuffer header)
Read the Xing Properties from the buffer
|
Modifier and Type | Method and Description |
---|---|
int |
getAudioSize() |
int |
getFrameCount() |
LameFrame |
getLameFrame() |
boolean |
isAudioSizeEnabled() |
boolean |
isFrameCountEnabled() |
boolean |
isVbr()
Is this XingFrame detailing a variable bit rate MPEG
|
static java.nio.ByteBuffer |
isXingFrame(java.nio.ByteBuffer bb,
MPEGFrameHeader mpegFrameHeader)
IS this a Xing frame
|
static XingFrame |
parseXingFrame(java.nio.ByteBuffer header)
Parse the XingFrame of an MP3File, cannot be called until we have validated that
this is a XingFrame
|
private void |
setAudioSize()
Set size of AudioData
|
private void |
setFrameCount()
Set count of frames
|
private void |
setVbr()
Set whether or not VBR, (Xing can also be used for CBR though this is less useful)
|
java.lang.String |
toString() |
private static final int MPEG_VERSION_1_MODE_MONO_OFFSET
private static final int MPEG_VERSION_1_MODE_STEREO_OFFSET
private static final int MPEG_VERSION_2_MODE_MONO_OFFSET
private static final int MPEG_VERSION_2_MODE_STEREO_OFFSET
private static final int XING_HEADER_BUFFER_SIZE
private static final int XING_IDENTIFIER_BUFFER_SIZE
private static final int XING_FLAG_BUFFER_SIZE
private static final int XING_FRAMECOUNT_BUFFER_SIZE
private static final int XING_AUDIOSIZE_BUFFER_SIZE
public static final int MAX_BUFFER_SIZE_NEEDED_TO_READ_XING
private static final int BYTE_1
private static final int BYTE_2
private static final int BYTE_3
private static final int BYTE_4
private static final byte[] XING_VBR_ID
private static final byte[] XING_CBR_ID
private java.nio.ByteBuffer header
private boolean vbr
private boolean isFrameCountEnabled
private int frameCount
private boolean isAudioSizeEnabled
private int audioSize
private LameFrame lameFrame
private XingFrame(java.nio.ByteBuffer header)
public LameFrame getLameFrame()
private void setVbr()
private void setFrameCount()
public final boolean isFrameCountEnabled()
public final int getFrameCount()
private void setAudioSize()
public final boolean isAudioSizeEnabled()
public final int getAudioSize()
public static XingFrame parseXingFrame(java.nio.ByteBuffer header) throws InvalidAudioFrameException
InvalidAudioFrameException
public static java.nio.ByteBuffer isXingFrame(java.nio.ByteBuffer bb, MPEGFrameHeader mpegFrameHeader)
bb
- mpegFrameHeader
- public final boolean isVbr()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005-2013 java.net. All Rights Reserved.