|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthelliker.id3.MPEGAudioFrameHeader
public class MPEGAudioFrameHeader
This class reads through the file specified and tries to find an mpeg frame.
It then reads data from the header of the first frame encountered.
| Field Summary | |
|---|---|
static int |
FREE_FORMAT
|
static int |
MONO_MODE
Mono |
static int |
MPEG_L_1
Layer I |
static int |
MPEG_L_2
Layer II |
static int |
MPEG_L_3
Layer III |
static int |
MPEG_V_1
MPEG Version 1 |
static int |
MPEG_V_2
MPEG Version 2 |
static int |
MPEG_V_25
MPEG Version 2.5 |
static int |
NULL
|
| Constructor Summary | |
|---|---|
MPEGAudioFrameHeader(File mp3)
Create an MPEGAudioFrameHeader from the file specified. |
|
MPEGAudioFrameHeader(File mp3,
int minSyncRange)
Create an MPEGAudioFrameHeader from the file specified. |
|
| Method Summary | |
|---|---|
boolean |
analyzeVBR()
Analyzes a VBR file that does not have a XING of VBRI header. |
int |
calculateBitrate(long length)
Calculates the bibtrate from the length of an unpadded frame. |
int |
getBitRate()
Returns the bitrate of this mpeg. |
String |
getChannelMode()
Return the channel mode of the mpeg in string form. |
String |
getEmphasis()
Returns the emphasis. |
int |
getFrameLength()
Computes the length of the frame found. |
String |
getLayer()
Return the layer description of the mpeg in string form. |
long |
getLocation()
Returns the offset at which the first mpeg frame was found in the file. |
int |
getNumFrames()
Returns the number of frames in this mpeg file. |
int |
getSampleRate()
Returns the sample rate of the mpeg in Hz |
int |
getVBRPlayingTime()
Returns the playing time of a variable bitrate file. |
String |
getVersion()
Return the version of the mpeg in string form. |
boolean |
hasPadding()
Returns true if the mpeg frames are padded in this file. |
boolean |
isCopyrighted()
Returns true if the audio is copyrighted |
boolean |
isMP3()
Returns true if the file passed to the constructor is an mp3 (MPEG layer III). |
boolean |
isOriginal()
Returns true if this is the original media |
boolean |
isProtected()
Returns true if this mpeg is protected by CRC |
boolean |
isVBR()
Returns true if this mpeg is encoded in VBR |
static void |
main(String[] argv)
|
boolean |
privateBitSet()
Returns true if the private bit is set. |
String |
toString()
Return a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int FREE_FORMAT
public static final int NULL
public static final int MPEG_V_25
public static final int MPEG_V_2
public static final int MPEG_V_1
public static final int MPEG_L_3
public static final int MPEG_L_2
public static final int MPEG_L_1
public static final int MONO_MODE
| Constructor Detail |
|---|
public MPEGAudioFrameHeader(File mp3)
throws NoMPEGFramesException,
IOException
mp3 - the file to read from
NoMPEGFramesException - if the file is not a valid mpeg
FileNotFoundException - if an error occurs
IOException - if an error occurs
public MPEGAudioFrameHeader(File mp3,
int minSyncRange)
throws NoMPEGFramesException,
IOException
mp3 - the file to read fromminSyncRange - this is the minimum length of the file
that is searched for consecutive
headers
NoMPEGFramesException - if the file is not a valid mpeg
FileNotFoundException - if an error occurs
IOException - if an error occurs| Method Detail |
|---|
public int getFrameLength()
public int calculateBitrate(long length)
getFrameLength().
length - the length in bytes of an unpadded framepublic String toString()
toString in class Objectpublic String getVersion()
public String getLayer()
public String getChannelMode()
public int getSampleRate()
public boolean isCopyrighted()
public boolean isProtected()
public boolean isOriginal()
public boolean isVBR()
public String getEmphasis()
public long getLocation()
public boolean isMP3()
public boolean hasPadding()
public boolean privateBitSet()
public int getVBRPlayingTime()
public boolean analyzeVBR()
throws IOException
IOExceptionpublic int getBitRate()
public int getNumFrames()
analyzeVBR() succeeded.
public static void main(String[] argv)
throws Exception
Exception
|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||