entagged.audioformats.mp3.util
Class MPEGFrame

java.lang.Object
  extended by entagged.audioformats.mp3.util.MPEGFrame

public class MPEGFrame
extends Object

Create a MPEG Frame object that represent a Mpeg frame in a mp3 file !! Contains an exception that should be modified !! $Id: MPEGFrame.java,v 1.1 2007/03/23 14:17:02 nicov1 Exp $

Version:
v0.03
Author:
Rapha�l Slinckx (KiKiDonK)

Field Summary
static int CHANNEL_MODE_DUAL_CHANNEL
          Constant holding the Dual Channel Stereo Mode
static int CHANNEL_MODE_JOINT_STEREO
          Constant holding the Joint Stereo Mode
static int CHANNEL_MODE_MONO
          Constant holding the Mono Mode
static int CHANNEL_MODE_STEREO
          Constant holding the Stereo Mode
static int LAYER_I
          Constant holding the Layer 1 value Mpeg frame
static int LAYER_II
          Constant holding the Layer 2 value Mpeg frame
static int LAYER_III
          Constant holding the Layer 3 value Mpeg frame
static int LAYER_RESERVED
          Constant holding the Reserved Layer value Mpeg frame
static int MPEG_VERSION_1
          Constant holding the mpeg frame version 1
static int MPEG_VERSION_2
          Constant holding the mpeg frame version 2
static int MPEG_VERSION_2_5
          Constant holding the mpeg frame version 2.5
static int MPEG_VERSION_RESERVED
          Constant holding the reserved mpeg frame
 
Constructor Summary
MPEGFrame(byte[] b)
          Creates a new MPEG frame with the given bytre array and decodes its contents
 
Method Summary
 String channelModeToString(int i)
          get a string representation of the channel mode of this frame
 int getBitrate()
          Gets the bitrate attribute of the MPEGFrame object
 int getChannelMode()
           
 int getChannelNumber()
          Gets the channelMode attribute of the MPEGFrame object
 int getFrameLength()
           
 int getLayerVersion()
          Gets the layerVersion attribute of the MPEGFrame object
 int getMPEGVersion()
          Gets the mPEGVersion attribute of the MPEGFrame object
 int getPaddingLength()
          Gets the paddingLength attribute of the MPEGFrame object
 int getSampleNumber()
           
 int getSamplingRate()
          Gets the samplingRate attribute of the MPEGFrame object
 boolean isValid()
          Verify if this frame is a valid one
 String layerToString(int i)
          Get the string representation of the layer version given the constant representing it
 String MPEGVersionToString(int i)
          The Mpeg version of this frame in a string representation
 String toString()
          Creates a string representation of this mpeg frame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CHANNEL_MODE_DUAL_CHANNEL

public static final int CHANNEL_MODE_DUAL_CHANNEL
Constant holding the Dual Channel Stereo Mode

See Also:
Constant Field Values

CHANNEL_MODE_JOINT_STEREO

public static final int CHANNEL_MODE_JOINT_STEREO
Constant holding the Joint Stereo Mode

See Also:
Constant Field Values

CHANNEL_MODE_MONO

public static final int CHANNEL_MODE_MONO
Constant holding the Mono Mode

See Also:
Constant Field Values

CHANNEL_MODE_STEREO

public static final int CHANNEL_MODE_STEREO
Constant holding the Stereo Mode

See Also:
Constant Field Values

LAYER_I

public static final int LAYER_I
Constant holding the Layer 1 value Mpeg frame

See Also:
Constant Field Values

LAYER_II

public static final int LAYER_II
Constant holding the Layer 2 value Mpeg frame

See Also:
Constant Field Values

LAYER_III

public static final int LAYER_III
Constant holding the Layer 3 value Mpeg frame

See Also:
Constant Field Values

LAYER_RESERVED

public static final int LAYER_RESERVED
Constant holding the Reserved Layer value Mpeg frame

See Also:
Constant Field Values

MPEG_VERSION_1

public static final int MPEG_VERSION_1
Constant holding the mpeg frame version 1

See Also:
Constant Field Values

MPEG_VERSION_2

public static final int MPEG_VERSION_2
Constant holding the mpeg frame version 2

See Also:
Constant Field Values

MPEG_VERSION_2_5

public static final int MPEG_VERSION_2_5
Constant holding the mpeg frame version 2.5

See Also:
Constant Field Values

MPEG_VERSION_RESERVED

public static final int MPEG_VERSION_RESERVED
Constant holding the reserved mpeg frame

See Also:
Constant Field Values
Constructor Detail

MPEGFrame

public MPEGFrame(byte[] b)
Creates a new MPEG frame with the given bytre array and decodes its contents

Parameters:
b - the array of bytes representing this mpeg frame
Method Detail

getBitrate

public int getBitrate()
Gets the bitrate attribute of the MPEGFrame object

Returns:
The bitrate value

getChannelNumber

public int getChannelNumber()
Gets the channelMode attribute of the MPEGFrame object

Returns:
The channelMode value

getChannelMode

public int getChannelMode()

getLayerVersion

public int getLayerVersion()
Gets the layerVersion attribute of the MPEGFrame object

Returns:
The layerVersion value

getMPEGVersion

public int getMPEGVersion()
Gets the mPEGVersion attribute of the MPEGFrame object

Returns:
The mPEGVersion value

getPaddingLength

public int getPaddingLength()
Gets the paddingLength attribute of the MPEGFrame object

Returns:
The paddingLength value

getSamplingRate

public int getSamplingRate()
Gets the samplingRate attribute of the MPEGFrame object

Returns:
The samplingRate value

isValid

public boolean isValid()
Verify if this frame is a valid one

Returns:
The isValid value

getFrameLength

public int getFrameLength()

getSampleNumber

public int getSampleNumber()

MPEGVersionToString

public String MPEGVersionToString(int i)
The Mpeg version of this frame in a string representation

Parameters:
i - the int constant of the version
Returns:
the string representation of the version

channelModeToString

public String channelModeToString(int i)
get a string representation of the channel mode of this frame

Parameters:
i - the constant holding the channel mode
Returns:
the string representation of this mode

layerToString

public String layerToString(int i)
Get the string representation of the layer version given the constant representing it

Parameters:
i - the constant holding the layer information
Returns:
the string representation of this layer version

toString

public String toString()
Creates a string representation of this mpeg frame

Overrides:
toString in class Object
Returns:
the string representing this frame


Copyright © 2007-2008. All Rights Reserved.