|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jaudiotagger.audio.mp3.VbriFrame
public class VbriFrame
Vrbi Frame
In MP3s encoded using the franhofer encoder which variable bit rate the first frame in the file contains a special frame called a Vrbi Frame, instead of audio data (Other Vbr encoders use the more common Xing Frame). 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.
From http://www.codeproject.com/KB/audio-video/mpegaudioinfo.aspx#SideInfo This header is only used by MPEG audio files encoded with the Fraunhofer Encoder as far as I know. It is different from the XING header. You find it exactly 32 bytes after the end of the first MPEG audio header in the file. (Note that the position is zero-based; position, length and example are each in byte-format.) Position Length Meaning Example 0 4 VBR header ID in 4 ASCII chars, always 'VBRI', not NULL-terminated 'VBRI' 4 2 Version ID as Big-Endian WORD 1 6 2 Delay as Big-Endian float 7344 8 2 Quality indicator 75 10 4 Number of Bytes of Audio as Big-Endian DWORD 45000 14 4 Number of Frames as Big-Endian DWORD 7344 18 2 Number of entries within TOC table as Big-Endian WORD 100 20 2 Scale factor of TOC table entries as Big-Endian DWORD 1 22 2 Size per table entry in bytes (max 4) as Big-Endian WORD 2 24 2 Frames per table entry as Big-Endian WORD 845 26 TOC entries for seeking as Big-Endian integral. From size per table entry and number of entries, you can calculate the length of this field.
Field Summary | |
---|---|
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 static java.nio.ByteBuffer |
header
|
private LameFrame |
lameFrame
|
static int |
MAX_BUFFER_SIZE_NEEDED_TO_READ_VBRI
|
private boolean |
vbr
|
private static int |
VBRI_AUDIOSIZE_BUFFER_SIZE
|
private static int |
VBRI_DELAY_BUFFER_SIZE
|
private static int |
VBRI_FRAMECOUNT_BUFFER_SIZE
|
private static int |
VBRI_HEADER_BUFFER_SIZE
|
private static int |
VBRI_IDENTIFIER_BUFFER_SIZE
|
private static int |
VBRI_OFFSET
|
private static int |
VBRI_QUALITY_BUFFER_SIZE
|
private static int |
VBRI_TOC_ENTRY_BUFFER_SIZE
|
private static byte[] |
VBRI_VBR_ID
Identifier |
Constructor Summary | |
---|---|
private |
VbriFrame()
Read the VBRI Properties from the buffer |
Method Summary | |
---|---|
int |
getAudioSize()
|
java.lang.String |
getEncoder()
|
int |
getFrameCount()
|
boolean |
isVbr()
Is this VBRIFrame detailing a varaible bit rate MPEG |
static boolean |
isVbriFrame(java.nio.ByteBuffer bb,
MPEGFrameHeader mpegFrameHeader)
IS this a VBRI frame |
static VbriFrame |
parseVBRIFrame()
Parse the VBRIFrame of an MP3File, cannot be called until we have validated that this is a VBRIFrame |
private void |
setAudioSize()
Set size of AudioData |
private void |
setFrameCount()
Set count of frames |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final int VBRI_OFFSET
private static final int VBRI_HEADER_BUFFER_SIZE
private static final int VBRI_IDENTIFIER_BUFFER_SIZE
private static final int VBRI_DELAY_BUFFER_SIZE
private static final int VBRI_QUALITY_BUFFER_SIZE
private static final int VBRI_AUDIOSIZE_BUFFER_SIZE
private static final int VBRI_FRAMECOUNT_BUFFER_SIZE
private static final int VBRI_TOC_ENTRY_BUFFER_SIZE
public static final int MAX_BUFFER_SIZE_NEEDED_TO_READ_VBRI
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[] VBRI_VBR_ID
private static java.nio.ByteBuffer header
private boolean vbr
private int frameCount
private int audioSize
private LameFrame lameFrame
Constructor Detail |
---|
private VbriFrame()
Method Detail |
---|
private void setAudioSize()
private void setFrameCount()
public final int getFrameCount()
public final int getAudioSize()
public static VbriFrame parseVBRIFrame() throws InvalidAudioFrameException
InvalidAudioFrameException
public static boolean isVbriFrame(java.nio.ByteBuffer bb, MPEGFrameHeader mpegFrameHeader)
bb
- mpegFrameHeader
-
public final boolean isVbr()
public java.lang.String getEncoder()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |