org.kc7bfi.jflac.frame
Class Header

java.lang.Object
  extended by org.kc7bfi.jflac.frame.Header

public class Header
extends Object

Frame header class.

Author:
kc7bfi

Field Summary
 int bitsPerSample
          The sample resolution.
 int blockSize
          The number of samples per subframe.
 int channelAssignment
          The channel assignment for the frame.
 int channels
          The number of channels (== number of subframes).
protected  byte crc
          CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0).
 int frameNumber
          The frame number or sample number of first sample in frame.
 long sampleNumber
          The sample number for the first sample in the frame.
 int sampleRate
          The sample rate in Hz.
 
Constructor Summary
Header(BitInputStream is, byte[] headerWarmup, StreamInfo streamInfo)
          The constructor.
 
Method Summary
 String toString()
          Return a descriptive string for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

blockSize

public int blockSize
The number of samples per subframe.


sampleRate

public int sampleRate
The sample rate in Hz.


channels

public int channels
The number of channels (== number of subframes).


channelAssignment

public int channelAssignment
The channel assignment for the frame.


bitsPerSample

public int bitsPerSample
The sample resolution.


frameNumber

public int frameNumber
The frame number or sample number of first sample in frame. use the number_type value to determine which to use.


sampleNumber

public long sampleNumber
The sample number for the first sample in the frame.


crc

protected byte crc
CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0). of the raw frame header bytes, meaning everything before the CRC byte including the sync code.

Constructor Detail

Header

public Header(BitInputStream is,
              byte[] headerWarmup,
              StreamInfo streamInfo)
       throws IOException,
              BadHeaderException
The constructor.

Parameters:
is - The InputBitStream
headerWarmup - The header warm-up bytes
streamInfo - The FLAC Stream Info
Throws:
IOException - Thrown on error reading InputBitStream
BadHeaderException - Thrown if header is bad
Method Detail

toString

public String toString()
Return a descriptive string for this object.

Overrides:
toString in class Object
Returns:
the string description
See Also:
Object.toString()


Copyright © 2004-2011. All Rights Reserved.