org.kc7bfi.jflac.metadata
Class StreamInfo

java.lang.Object
  extended by org.kc7bfi.jflac.metadata.Metadata
      extended by org.kc7bfi.jflac.metadata.StreamInfo

public class StreamInfo
extends Metadata

StreamInfo Metadata block.

Author:
kc7bfi

Field Summary
 
Fields inherited from class org.kc7bfi.jflac.metadata.Metadata
isLast, METADATA_TYPE_APPLICATION, METADATA_TYPE_CUESHEET, METADATA_TYPE_PADDING, METADATA_TYPE_PICTURE, METADATA_TYPE_SEEKTABLE, METADATA_TYPE_STREAMINFO, METADATA_TYPE_VORBIS_COMMENT, STREAM_METADATA_IS_LAST_LEN, STREAM_METADATA_LENGTH_LEN, STREAM_METADATA_TYPE_LEN
 
Constructor Summary
StreamInfo(BitInputStream is, int length, boolean isLast)
          The constructor.
 
Method Summary
 void addTotalSamples(long totalSamples)
           
 int calcLength()
          Calculate the metadata block size.
 boolean compatiable(StreamInfo info)
          Check for compatiable StreamInfo.
 AudioFormat getAudioFormat()
           
 int getBitsPerSample()
           
 int getChannels()
           
 int getMaxBlockSize()
           
 int getMaxFrameSize()
           
 int getMinBlockSize()
           
 int getMinFrameSize()
           
 int getSampleRate()
           
 long getTotalSamples()
           
 void setTotalSamples(long totalSamples)
           
 String toString()
          Convert to string.
 void write(BitOutputStream os, boolean isLast)
          Write out the metadata block.
 
Methods inherited from class org.kc7bfi.jflac.metadata.Metadata
isLast
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StreamInfo

public StreamInfo(BitInputStream is,
                  int length,
                  boolean isLast)
           throws IOException
The constructor.

Parameters:
is - The InputBitStream
length - Length of the record
isLast - True if this is the last Metadata block in the chain
Throws:
IOException - Thrown if error reading from InputBitStream
Method Detail

write

public void write(BitOutputStream os,
                  boolean isLast)
           throws IOException
Write out the metadata block.

Parameters:
os - The output stream
isLast - True if this is the last metadata block
Throws:
IOException - Thrown if error writing data

calcLength

public int calcLength()
Calculate the metadata block size.

Returns:
The metadata block size

compatiable

public boolean compatiable(StreamInfo info)
Check for compatiable StreamInfo. Checks if sampleRate, channels, and bitsPerSample are equal

Parameters:
info - The StreamInfo block to check
Returns:
True if this and info are compatable

toString

public String toString()
Convert to string.

Overrides:
toString in class Object
See Also:
Object.toString()

getMaxBlockSize

public int getMaxBlockSize()
Returns:
Returns the maxBlockSize.

getMinBlockSize

public int getMinBlockSize()
Returns:
Returns the minBlockSize.

getTotalSamples

public long getTotalSamples()
Returns:
Returns the totalSamples.

setTotalSamples

public void setTotalSamples(long totalSamples)
Parameters:
totalSamples - The totalSamples to set.

addTotalSamples

public void addTotalSamples(long totalSamples)
Parameters:
totalSamples - The totalSamples to add.

getMaxFrameSize

public int getMaxFrameSize()
Returns:
Returns the maxFrameSize.

getMinFrameSize

public int getMinFrameSize()
Returns:
Returns the minFrameSize.

getSampleRate

public int getSampleRate()
Returns:
Returns the sampleRate.

getAudioFormat

public AudioFormat getAudioFormat()
Returns:
the Java Sound AudioFormat for this stream info.

getBitsPerSample

public int getBitsPerSample()
Returns:
Returns the bitsPerSample.

getChannels

public int getChannels()
Returns:
Returns the channels.


Copyright © 2004-2011. All Rights Reserved.