org.tritonus.share.sampled.convert
Class TAsynchronousFilteredAudioInputStream
java.lang.Object
java.io.InputStream
javax.sound.sampled.AudioInputStream
org.tritonus.share.sampled.convert.TAudioInputStream
org.tritonus.share.sampled.convert.TAsynchronousFilteredAudioInputStream
- All Implemented Interfaces:
- Closeable, TCircularBuffer.Trigger
- Direct Known Subclasses:
- GSMFormatConversionProvider.DecodedGSMAudioInputStream, GSMFormatConversionProvider.EncodedGSMAudioInputStream, JorbisFormatConversionProvider.DecodedJorbisAudioInputStream, Mp3LameFormatConversionProvider.EncodedMpegAudioInputStream, VorbisFormatConversionProvider.DecodedVorbisAudioInputStream, 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.
- Author:
- Matthias Pfisterer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
getCircularBuffer
protected TCircularBuffer getCircularBuffer()
- Returns the circular buffer.
writeMore
protected boolean writeMore()
- Check if writing more data to the circular buffer is recommanded.
This checks the available write space in the circular buffer
against the minimum available property. If the available write
space is greater than th minimum available property, more
writing is encouraged, so this method returns true.
Note that this is only a hint to subclasses. However,
it is an important hint.
- Returns:
- true if more writing to the circular buffer is
recommanden. Otherwise, false is returned.
read
public int read()
throws IOException
- Overrides:
read
in class AudioInputStream
- Throws:
IOException
read
public int read(byte[] abData)
throws IOException
- Overrides:
read
in class AudioInputStream
- Throws:
IOException
read
public int read(byte[] abData,
int nOffset,
int nLength)
throws IOException
- Overrides:
read
in class AudioInputStream
- Throws:
IOException
skip
public long skip(long lSkip)
throws IOException
- Overrides:
skip
in class AudioInputStream
- Throws:
IOException
available
public int available()
throws IOException
- Overrides:
available
in class AudioInputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class AudioInputStream
- Throws:
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 IOException
- Overrides:
reset
in class AudioInputStream
- Throws:
IOException