org.tritonus.share.sampled.convert
Class TAsynchronousFilteredAudioInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by javax.sound.sampled.AudioInputStream
          extended by org.tritonus.share.sampled.convert.TAudioInputStream
              extended by org.tritonus.share.sampled.convert.TAsynchronousFilteredAudioInputStream
All Implemented Interfaces:
java.io.Closeable, TCircularBuffer.Trigger
Direct Known Subclasses:
GSMFormatConversionProvider.DecodedGSMAudioInputStream, GSMFormatConversionProvider.EncodedGSMAudioInputStream, JorbisFormatConversionProvider.DecodedJorbisAudioInputStream, Mp3LameFormatConversionProvider.EncodedMpegAudioInputStream, MpegFormatConversionProvider.DecodedMpegAudioInputStream, VorbisFormatConversionProvider.DecodedVorbisAudioInputStream, VorbisFormatConversionProvider.DecodedVorbisAudioInputStream, VorbisFormatConversionProvider.EncodedVorbisAudioInputStream, VorbisFormatConversionProvider.EncodedVorbisAudioInputStream

public abstract class TAsynchronousFilteredAudioInputStream
extends TAudioInputStream
implements TCircularBuffer.Trigger

Base class for asynchronus converters. This class serves as base class for converters that do not have a fixed ratio between the size of a block of input data and the size of a block of output data. These types of converters therefore need an internal buffer, which is realized in this class.


Constructor Summary
TAsynchronousFilteredAudioInputStream(AudioFormat outputFormat, long lLength)
          Constructor.
TAsynchronousFilteredAudioInputStream(AudioFormat outputFormat, long lLength, int nBufferSize, int nMinAvailable)
          Constructor.
 
Method Summary
 int available()
           
 void close()
           
 void mark(int nReadLimit)
           
 boolean markSupported()
           
 int read()
           
 int read(byte[] abData)
           
 int read(byte[] abData, int nOffset, int nLength)
           
 void reset()
           
 long skip(long lSkip)
           
 
Methods inherited from class org.tritonus.share.sampled.convert.TAudioInputStream
properties
 
Methods inherited from class javax.sound.sampled.AudioInputStream
getFormat, getFrameLength
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.tritonus.share.TCircularBuffer.Trigger
execute
 

Constructor Detail

TAsynchronousFilteredAudioInputStream

public TAsynchronousFilteredAudioInputStream(AudioFormat outputFormat,
                                             long lLength)
Constructor. This constructor uses the default buffer size and the default min available amount.

Parameters:
lLength - length of this stream in frames. May be AudioSystem.NOT_SPECIFIED.

TAsynchronousFilteredAudioInputStream

public TAsynchronousFilteredAudioInputStream(AudioFormat outputFormat,
                                             long lLength,
                                             int nBufferSize,
                                             int nMinAvailable)
Constructor. With this constructor, the buffer size and the minimum available amount can be specified as parameters.

Parameters:
lLength - length of this stream in frames. May be AudioSystem.NOT_SPECIFIED.
nBufferSize - size of the circular buffer in bytes.
Method Detail

read

public int read()
         throws java.io.IOException
Overrides:
read in class AudioInputStream
Throws:
java.io.IOException

read

public int read(byte[] abData)
         throws java.io.IOException
Overrides:
read in class AudioInputStream
Throws:
java.io.IOException

read

public int read(byte[] abData,
                int nOffset,
                int nLength)
         throws java.io.IOException
Overrides:
read in class AudioInputStream
Throws:
java.io.IOException

skip

public long skip(long lSkip)
          throws java.io.IOException
Overrides:
skip in class AudioInputStream
Throws:
java.io.IOException

available

public int available()
              throws java.io.IOException
Overrides:
available in class AudioInputStream
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class AudioInputStream
Throws:
java.io.IOException

markSupported

public boolean markSupported()
Overrides:
markSupported in class AudioInputStream

mark

public void mark(int nReadLimit)
Overrides:
mark in class AudioInputStream

reset

public void reset()
           throws java.io.IOException
Overrides:
reset in class AudioInputStream
Throws:
java.io.IOException