public class VBRIHeader
extends java.lang.Object
A VBRI header is found in variable bit rate
encoded .mp3 files that were encoded using the Fraunhofer encoder.
The VBRI header is an optional header, and if present, will be found within the first MPEG audio frame directly following the MPEG side information. It is mutually
exclusive with the Xing
and LAME
headers. That is, if an Xing or Xing/LAME header is found in the first MPEG audio frame, then
a VBRI header can not occur and vice versa. If a VBRI header is found in the first MPEG audio frame, then neither an Xing or LAME header can be present.
The format of a variable bit rate encoded .mp3 file is shown below.
Modifier and Type | Field and Description |
---|---|
static int |
HEADER_MIN_SIZE
VBRI headers are at least 26 bytes long
|
Constructor and Description |
---|
VBRIHeader()
default constructor.
|
VBRIHeader(byte[] bytes,
java.io.InputStream inputStream)
constructor.
|
VBRIHeader(byte[] bytes,
int index)
constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getDelay()
gets the delay?
|
java.lang.String |
getId()
gets the VBRI header id which is always "VBRI".
|
int |
getNumBytes()
gets the number of bytes in the .mp3 file.
|
int |
getNumFrames()
gets the number of mpeg audio frames in the .mp3 file.
|
int |
getNumTOCEntries()
gets the number of entries in the table of contents.
|
int |
getQuality()
gets the quality value, which has a range of [0 - 100], where 0 is the best and 100 is the worst.
|
int |
getSize()
gets the size (in bytes) of the VBRI header.
|
byte[][] |
getTableOfContents()
gets the table of contents, which specifies entries used for seeking mpeg audio frames within the .mp3 file.
|
int |
getTOCEntryNumFrames()
gets the number of frames per entry in the table of contents.
|
int |
getTOCEntryScaleFactor()
gets the scale factor for the entries in the table of contents.
|
int |
getTOCEntrySize()
gets the size of each entry in the table of contents.
|
int |
getVersion()
gets the VBRI header version.
|
java.lang.String |
toString() |
public static final int HEADER_MIN_SIZE
public VBRIHeader()
public VBRIHeader(byte[] bytes, int index) throws ParseException
bytes
- the raw bytes of an MPEG audio frame.index
- the offset into the bytes of the MPEG audio frame where the VBRI header begins.ParseException
- if an invalid value is detected while parsing the VBRI header's raw bytes.public VBRIHeader(byte[] bytes, java.io.InputStream inputStream) throws java.io.IOException, ParseException
bytes
- bytes read in from the previous attempt to find the Xing header.inputStream
- input stream pointing to the VBRI header in an mpeg audio frame in an .mp3 file.java.io.IOException
- if there is an error while reading the VBRI header from the .mp3 file.ParseException
- if an invalid value is detected while parsing the VBRI header's raw bytes.public int getSize()
public java.lang.String getId()
public int getVersion()
public int getDelay()
public int getQuality()
public int getNumBytes()
public int getNumFrames()
public int getNumTOCEntries()
public int getTOCEntryScaleFactor()
public int getTOCEntrySize()
public int getTOCEntryNumFrames()
public byte[][] getTableOfContents()
public java.lang.String toString()
toString
in class java.lang.Object