javaFlacEncoder
Class FrameHeader

java.lang.Object
  extended by javaFlacEncoder.FrameHeader

public class FrameHeader
extends java.lang.Object

This class is used to generate a Frame Header for a FLAC Frame.

Author:
Preston Lacey

Field Summary
static int DEBUG_LEV
          For Debugging: Higher level equals more debug statements
static int MAX_HEADER_SIZE
          Maximum size a header can be according to FLAC specification.
static short syncCode
          Synchronization code used at beginning of frame(low-order 14 bits used)
 
Constructor Summary
FrameHeader()
          Constructor creates a new FrameHeader object which is ready to generate headers.
 
Method Summary
 EncodedElement createHeader(boolean fixBlock, int blockSize, int sampleRate, EncodingConfiguration.ChannelConfig channelAssign, int sampleSize, long frameNumber, int channelCount, EncodedElement result)
          Create the header for a frame with the given parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_LEV

public static int DEBUG_LEV
For Debugging: Higher level equals more debug statements


MAX_HEADER_SIZE

public static final int MAX_HEADER_SIZE
Maximum size a header can be according to FLAC specification.

See Also:
Constant Field Values

syncCode

public static final short syncCode
Synchronization code used at beginning of frame(low-order 14 bits used)

See Also:
Constant Field Values
Constructor Detail

FrameHeader

public FrameHeader()
Constructor creates a new FrameHeader object which is ready to generate headers. We can't use static functions to do this, since the process uses a CRC8 object which must be instantiated.

Method Detail

createHeader

public EncodedElement createHeader(boolean fixBlock,
                                   int blockSize,
                                   int sampleRate,
                                   EncodingConfiguration.ChannelConfig channelAssign,
                                   int sampleSize,
                                   long frameNumber,
                                   int channelCount,
                                   EncodedElement result)
Create the header for a frame with the given parameters. Header data is stored out to an EncodedElement, in the proper form for a FLAC stream.

Parameters:
fixBlock - True to use a fixed block size, false to use variable. At this time, this *must* be set to True, as variable block size is not yet implemented.
blockSize - Block Size of this frame.
sampleRate - Sample rate of this frame.
channelAssign - Channel assignment used in this frame's encoding. See EncodingConfiguration class documentation for more information.
sampleSize - Bits per sample.
frameNumber - For fixed block-size encodings, this is the frame-number starting at zero and incrementing by one. For variable block encodings, this is the sample number of the first sample in the frame.
channelCount - Number of channels in the stream.
Returns:
EncodedElement where the header is saved to.