javaFlacEncoder
Class MetadataBlockStreamInfo

java.lang.Object
  extended by javaFlacEncoder.MetadataBlockStreamInfo

public class MetadataBlockStreamInfo
extends java.lang.Object

MetadataBlockStreamInfo is used to declare the initial stream parameters, such as Sample Rate, bits per sample, and number of channels, as well as information on the encoded stream such as total number of samples, minimum and maximum block and frame sizes, and md5sum of raw audio samples. A StreamInfo block must be the first meta-data block in a FLAC stream, and only one StreamInfo block may exist.

Author:
Preston Lacey

Constructor Summary
MetadataBlockStreamInfo()
          Constructor.
 
Method Summary
static int getByteSize()
          Get the expected size of a properly formed STREAMINFO metadata block.
static EncodedElement getStreamInfo(StreamConfiguration sc, int minFrameSize, int maxFrameSize, long samplesInStream, byte[] md5Hash)
          Create a FLAC StreamInfo metadata block with the given parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataBlockStreamInfo

public MetadataBlockStreamInfo()
Constructor. This class defines only static methods and fields.

Method Detail

getStreamInfo

public static EncodedElement getStreamInfo(StreamConfiguration sc,
                                           int minFrameSize,
                                           int maxFrameSize,
                                           long samplesInStream,
                                           byte[] md5Hash)
Create a FLAC StreamInfo metadata block with the given parameters. Because of the data stored in a StreamInfo block, this should generally be created only after all encoding is done.

Parameters:
sc - StreamConfiguration used in this FLAC stream.
minFrameSize - Size of smallest frame in FLAC stream.
maxFrameSize - Size of largest frame in FLAC stream.
samplesInStream - Total number of inter-channel audio samples in FLAC stream.
md5Hash - MD5 hash of the raw audio samples.
Returns:
EncodedElement containing created StreamInfo block.

getByteSize

public static int getByteSize()
Get the expected size of a properly formed STREAMINFO metadata block.

Returns:
size of properly formed FLAC STREAMINFO metadata block.