javazoom.jl.decoder
Class Header

java.lang.Object
  extended by javazoom.jl.decoder.Header

public final class Header
extends java.lang.Object

Class for extracting information from a frame header.


Field Summary
static java.lang.String[][][] bitrate_str
           
static int[][][] bitrates
           
 short checksum
           
static int DUAL_CHANNEL
           
static int FOURTYEIGHT
           
static int FOURTYFOUR_POINT_ONE
           
 int framesize
           
static int[][] frequencies
           
static int JOINT_STEREO
           
static int MPEG1
          Constant for MPEG-1 version
static int MPEG2_LSF
          Constant for MPEG-2 LSF version
static int MPEG25_LSF
           
 int nSlots
           
static int SINGLE_CHANNEL
           
static int STEREO
           
static int THIRTYTWO
           
 
Method Summary
 int bitrate_index()
          Returns bitrate index.
 int bitrate_instant()
          Return Instant Bitrate.
 java.lang.String bitrate_string()
          Return Bitrate.
 int bitrate()
          Return Bitrate.
 int calculate_framesize()
          Calculate Frame size.
 boolean checksum_ok()
          Returns Checksum flag.
 boolean checksums()
          Returns Protection bit.
 boolean copyright()
          Returns Copyright.
 int frequency()
          Returns Frequency.
 int getSyncHeader()
          Returns synchronized header.
 int intensity_stereo_bound()
          Returns Intensity Stereo.
 java.lang.String layer_string()
          Return Layer version.
 int layer()
          Returns Layer ID.
 int max_number_of_frames(int streamsize)
          Returns the maximum number of frames in the stream.
 int min_number_of_frames(int streamsize)
          Returns the maximum number of frames in the stream.
 int mode_extension()
          Returns Mode Extension.
 java.lang.String mode_string()
          Returns Mode.
 int mode()
          Returns Mode.
 float ms_per_frame()
          Returns ms/frame.
 int number_of_subbands()
          Returns the number of subbands in the current frame.
 boolean original()
          Returns Original.
 boolean padding()
          Returns Layer III Padding bit.
 java.lang.String sample_frequency_string()
          Returns Frequency
 int sample_frequency()
          Returns Sample Frequency.
 int slots()
          Returns Slots.
 java.lang.String toString()
           
 float total_ms(int streamsize)
          Returns total ms.
 int vbr_scale()
          Return VBR scale.
 byte[] vbr_toc()
          Return VBR TOC.
 boolean vbr()
          Return VBR.
 java.lang.String version_string()
          Returns Version.
 int version()
          Returns version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

frequencies

public static final int[][] frequencies

MPEG2_LSF

public static final int MPEG2_LSF
Constant for MPEG-2 LSF version

See Also:
Constant Field Values

MPEG25_LSF

public static final int MPEG25_LSF
See Also:
Constant Field Values

MPEG1

public static final int MPEG1
Constant for MPEG-1 version

See Also:
Constant Field Values

STEREO

public static final int STEREO
See Also:
Constant Field Values

JOINT_STEREO

public static final int JOINT_STEREO
See Also:
Constant Field Values

DUAL_CHANNEL

public static final int DUAL_CHANNEL
See Also:
Constant Field Values

SINGLE_CHANNEL

public static final int SINGLE_CHANNEL
See Also:
Constant Field Values

FOURTYFOUR_POINT_ONE

public static final int FOURTYFOUR_POINT_ONE
See Also:
Constant Field Values

FOURTYEIGHT

public static final int FOURTYEIGHT
See Also:
Constant Field Values

THIRTYTWO

public static final int THIRTYTWO
See Also:
Constant Field Values

checksum

public short checksum

framesize

public int framesize

nSlots

public int nSlots

bitrates

public static final int[][][] bitrates

bitrate_str

public static final java.lang.String[][][] bitrate_str
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

version

public int version()
Returns version.


layer

public int layer()
Returns Layer ID.


bitrate_index

public int bitrate_index()
Returns bitrate index.


sample_frequency

public int sample_frequency()
Returns Sample Frequency.


frequency

public int frequency()
Returns Frequency.


mode

public int mode()
Returns Mode.


checksums

public boolean checksums()
Returns Protection bit.


copyright

public boolean copyright()
Returns Copyright.


original

public boolean original()
Returns Original.


vbr

public boolean vbr()
Return VBR.

Returns:
true if VBR header is found

vbr_scale

public int vbr_scale()
Return VBR scale.

Returns:
scale of -1 if not available

vbr_toc

public byte[] vbr_toc()
Return VBR TOC.

Returns:
vbr toc ot null if not available

checksum_ok

public boolean checksum_ok()
Returns Checksum flag. Compares computed checksum with stream checksum.


padding

public boolean padding()
Returns Layer III Padding bit.


slots

public int slots()
Returns Slots.


mode_extension

public int mode_extension()
Returns Mode Extension.


calculate_framesize

public int calculate_framesize()
Calculate Frame size. Calculates framesize in bytes excluding header size.


max_number_of_frames

public int max_number_of_frames(int streamsize)
Returns the maximum number of frames in the stream.

Parameters:
streamsize -
Returns:
number of frames

min_number_of_frames

public int min_number_of_frames(int streamsize)
Returns the maximum number of frames in the stream.

Parameters:
streamsize -
Returns:
number of frames

ms_per_frame

public float ms_per_frame()
Returns ms/frame.

Returns:
milliseconds per frame

total_ms

public float total_ms(int streamsize)
Returns total ms.

Parameters:
streamsize -
Returns:
total milliseconds

getSyncHeader

public int getSyncHeader()
Returns synchronized header.


layer_string

public java.lang.String layer_string()
Return Layer version.


bitrate_string

public java.lang.String bitrate_string()
Return Bitrate.

Returns:
bitrate in bps

bitrate

public int bitrate()
Return Bitrate.

Returns:
bitrate in bps and average bitrate for VBR header

bitrate_instant

public int bitrate_instant()
Return Instant Bitrate. Bitrate for VBR is not constant.

Returns:
bitrate in bps

sample_frequency_string

public java.lang.String sample_frequency_string()
Returns Frequency

Returns:
frequency string in kHz

mode_string

public java.lang.String mode_string()
Returns Mode.


version_string

public java.lang.String version_string()
Returns Version.

Returns:
MPEG-1 or MPEG-2 LSF or MPEG-2.5 LSF

number_of_subbands

public int number_of_subbands()
Returns the number of subbands in the current frame.

Returns:
number of subbands

intensity_stereo_bound

public int intensity_stereo_bound()
Returns Intensity Stereo. (Layer II joint stereo only). Returns the number of subbands which are in stereo mode, subbands above that limit are in intensity stereo mode.

Returns:
intensity


JavaZOOM 1999-2008