|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object helliker.id3.MPEGAudioFrameHeader
Field Summary | |
private int |
bitRate
|
private int[][] |
bitrateTable
|
private java.lang.String[] |
channelLabels
|
private int |
channelMode
|
private boolean |
copyrighted
|
private boolean |
crced
|
private int |
emphasis
|
private java.lang.String[] |
emphasisLabels
|
private int |
frameLength
|
private int |
HEADER_SIZE
|
private int |
layer
|
private java.lang.String[] |
layerLabels
|
private long |
location
|
static int |
MONO_MODE
|
private java.io.File |
mp3
|
static int |
MPEG_L_1
|
static int |
MPEG_L_2
|
static int |
MPEG_L_3
|
static int |
MPEG_V_1
|
static int |
MPEG_V_2
|
static int |
MPEG_V_25
|
private boolean |
original
|
private boolean |
padding
|
private boolean |
privateBit
|
private int |
sampleRate
|
private int[][] |
sampleTable
|
private int[] |
slotLength
|
private int |
version
|
private java.lang.String[] |
versionLabels
|
private XingVBRHeader |
xingHead
|
Constructor Summary | |
MPEGAudioFrameHeader(java.io.File mp3)
Create an MPEGAudioFrameHeader from the file specified. |
|
MPEGAudioFrameHeader(java.io.File mp3,
int offset)
Create an MPEGAudioFrameHeader from the file specified. |
Method Summary | |
private void |
findBitRate(int bitrateIndex)
Based on the bitrate index found in the header, try to find and set the bitrate from the table. |
private long |
findFrame(java.io.RandomAccessFile raf,
int offset)
Searches through the file and finds the first occurrence of an mpeg frame. |
private void |
findSampleRate(int sampleIndex)
Based on the sample rate index found in the header, attempt to lookup and set the sample rate from the table. |
int |
getBitRate()
Returns the bitrate of this mpeg. |
java.lang.String |
getChannelMode()
Return the channel mode of the mpeg in string form. |
java.lang.String |
getEmphasis()
Returns the emphasis. |
int |
getFrameLength()
Computes the length of the frame found. |
java.lang.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 |
getSampleRate()
Returns the sample rate of the mpeg in Hz |
int |
getVBRPlayingTime()
If this is a VBR file, return an accurate playing time of this mpeg. |
java.lang.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()
|
boolean |
privateBitSet()
Returns true if the private bit is set. |
private void |
readHeader(java.io.RandomAccessFile raf,
long location)
Read in all the information found in the mpeg header. |
java.lang.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 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
private final int HEADER_SIZE
private final int[][] bitrateTable
private final int[][] sampleTable
private final java.lang.String[] versionLabels
private final java.lang.String[] layerLabels
private final java.lang.String[] channelLabels
private final java.lang.String[] emphasisLabels
private final int[] slotLength
private XingVBRHeader xingHead
private java.io.File mp3
private int version
private int layer
private int bitRate
private int sampleRate
private int channelMode
private boolean copyrighted
private boolean crced
private boolean original
private boolean privateBit
private int emphasis
private long location
private int frameLength
private boolean padding
Constructor Detail |
public MPEGAudioFrameHeader(java.io.File mp3) throws NoMPEGFramesException, java.io.FileNotFoundException, java.io.IOException, CorruptHeaderException
mp3
- the file to read from
NoMPEGFramesException
- if the file is not a valid mpeg
java.io.FileNotFoundException
- if an error occurs
java.io.IOException
- if an error occurs
CorruptHeaderException
- if an error occurspublic MPEGAudioFrameHeader(java.io.File mp3, int offset) throws NoMPEGFramesException, java.io.FileNotFoundException, java.io.IOException, CorruptHeaderException
mp3
- the file to read fromoffset
- the offset to start searching from
NoMPEGFramesException
- if the file is not a valid mpeg
java.io.FileNotFoundException
- if an error occurs
java.io.IOException
- if an error occurs
CorruptHeaderException
- if an error occursMethod Detail |
private long findFrame(java.io.RandomAccessFile raf, int offset) throws java.io.IOException
raf
- the open file to find the frame inoffset
- the offset to start searching from
java.io.IOException
- if an error occursprivate void readHeader(java.io.RandomAccessFile raf, long location) throws java.io.IOException, CorruptHeaderException
raf
- the open file to find the frame inlocation
- the location of the header (found by findFrame)
CorruptHeaderException
- if an error occurs
java.io.IOException
- if an error occursprivate void findBitRate(int bitrateIndex)
bitrateIndex
- the bitrate index read from the headerprivate void findSampleRate(int sampleIndex)
sampleIndex
- the sample rate index read from the headerpublic int getFrameLength()
public java.lang.String toString()
public java.lang.String getVersion()
public java.lang.String getLayer()
public java.lang.String getChannelMode()
public int getSampleRate()
public boolean isCopyrighted()
public boolean isProtected()
public boolean isOriginal()
public boolean isVBR()
public java.lang.String getEmphasis()
public long getLocation()
public boolean isMP3()
public boolean hasPadding()
public boolean privateBitSet()
public int getVBRPlayingTime()
public int getBitRate()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |