org.esau.ptarmigan.impl
Class MPEGFrameHeader

java.lang.Object
  |
  +--org.esau.ptarmigan.impl.MPEGFrameHeader

public final class MPEGFrameHeader
extends java.lang.Object

MPEG Frame Header

Parse and validate a 4-byte MPEG Header

Version:
$Revision: 1.2 $ $Date: 2002/10/02 05:27:03 $
Author:
Reed Esau

Constructor Summary
MPEGFrameHeader()
          ctor
MPEGFrameHeader(MPEGFrameHeader other)
          copy ctor
 
Method Summary
 java.lang.String getAudioVersion()
           
 int getBitRate()
           
 java.lang.String getChannelDesc()
           
 int getChannelMode()
           
 int getChannels()
           
 boolean getCopyright()
           
 int getEmphasis()
           
 int getFrameLength()
           
 int getLayer()
           
 int getModeExt()
           
 boolean getOriginal()
           
 boolean getPadding()
           
 boolean getPrivateBit()
           
 boolean getProtection()
           
 int getSampleRate()
           
 boolean initHeader(byte[] buf, int offset)
          Try to identify a frame header in the specified buffer at the specified offset.
 void resetData()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MPEGFrameHeader

public MPEGFrameHeader()
ctor

MPEGFrameHeader

public MPEGFrameHeader(MPEGFrameHeader other)
copy ctor
Method Detail

initHeader

public boolean initHeader(byte[] buf,
                          int offset)
Try to identify a frame header in the specified buffer at the specified offset. Note that it's not definitive. You have to look for repeating MPEG frames and check CRCs to make sure. AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM
Returns:
false if not a valid frame header; true if it may be (but not definitive)

getAudioVersion

public java.lang.String getAudioVersion()

getLayer

public int getLayer()

getProtection

public boolean getProtection()

getPadding

public boolean getPadding()

getPrivateBit

public boolean getPrivateBit()

getChannelMode

public int getChannelMode()

getModeExt

public int getModeExt()

getChannels

public int getChannels()

getChannelDesc

public java.lang.String getChannelDesc()

getCopyright

public boolean getCopyright()

getOriginal

public boolean getOriginal()

getEmphasis

public int getEmphasis()

getBitRate

public int getBitRate()

getSampleRate

public int getSampleRate()

getFrameLength

public int getFrameLength()

resetData

public void resetData()


Copyright © 2002 Reed Esau, All Rights Reserved.