helliker.id3
Class MPEGAudioFrameHeader

java.lang.Object
  |
  +--helliker.id3.MPEGAudioFrameHeader

public class MPEGAudioFrameHeader
extends java.lang.Object


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
 int getBitRate()
          Returns the bitrate of the mpeg in kbps
 java.lang.String getChannelMode()
          Return the channel mode of the mpeg in string form.
 java.lang.String getEmphasis()
          Returns the emphasis.
 java.lang.String getLayer()
          Return the layer description of the mpeg in string form.
 int getSampleRate()
          Returns the sample rate of the mpeg in Hz
 java.lang.String getVersion()
          Return the version of the mpeg in string form.
 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
 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
 

Constructor Detail

MPEGAudioFrameHeader

public MPEGAudioFrameHeader(java.io.File mp3)
                     throws NoMPEGFramesException,
                            java.io.FileNotFoundException,
                            java.io.IOException
Create an MPEGAudioFrameHeader from the file specified. Upon creation information will be read in from the first frame header the object encounters in the file.
Parameters:
mp3 - the file to read from
Throws:
NoMPEGFramesException - if the file is not a valid mpeg
java.io.FileNotFoundException - if an error occurs
java.io.IOException - if an error occurs

MPEGAudioFrameHeader

public MPEGAudioFrameHeader(java.io.File mp3,
                            int offset)
                     throws NoMPEGFramesException,
                            java.io.FileNotFoundException,
                            java.io.IOException
Create an MPEGAudioFrameHeader from the file specified. Upon creation information will be read in from the first frame header the object encounters in the file. The offset tells the object where to start searching for an MPEG frame. If you know the size of an id3v2 tag attached to the file and pass it to this ctor, it will take less time to find the frame.
Parameters:
mp3 - the file to read from
offset - the offset to start searching from
Throws:
NoMPEGFramesException - if the file is not a valid mpeg
java.io.FileNotFoundException - if an error occurs
java.io.IOException - if an error occurs
Method Detail

toString

public java.lang.String toString()
Return a string representation of this object. Includes all information read in.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object

getVersion

public java.lang.String getVersion()
Return the version of the mpeg in string form. Ex: MPEG Version 1.0
Returns:
the version of the mpeg

getLayer

public java.lang.String getLayer()
Return the layer description of the mpeg in string form. Ex: Layer III
Returns:
the layer description of the mpeg

getChannelMode

public java.lang.String getChannelMode()
Return the channel mode of the mpeg in string form. Ex: Joint Stereo (STEREO)
Returns:
the channel mode of the mpeg

getBitRate

public int getBitRate()
Returns the bitrate of the mpeg in kbps
Returns:
the bitrate of the mpeg in kbps

getSampleRate

public int getSampleRate()
Returns the sample rate of the mpeg in Hz
Returns:
the sample rate of the mpeg in Hz

isCopyrighted

public boolean isCopyrighted()
Returns true if the audio is copyrighted
Returns:
true if the audio is copyrighted

isProtected

public boolean isProtected()
Returns true if this mpeg is protected by CRC
Returns:
true if this mpeg is protected by CRC

isOriginal

public boolean isOriginal()
Returns true if this is the original media
Returns:
true if this is the original media

getEmphasis

public java.lang.String getEmphasis()
Returns the emphasis. I don't know what this means, it just does it...
Returns:
the emphasis

isMP3

public boolean isMP3()
Returns true if the file passed to the constructor is an mp3 (MPEG layer III).
Returns:
true if the file is an mp3