public abstract class TSynchronousFilteredAudioInputStream extends TAudioInputStream implements FloatSampleInput
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
m_buffer
The intermediate buffer used during convert actions
(if not convertInPlace is used).
|
format, frameLength, framePos, frameSize| Constructor and Description |
|---|
TSynchronousFilteredAudioInputStream(AudioInputStream audioInputStream,
AudioFormat newFormat) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
protected abstract int |
convert(byte[] inBuffer,
byte[] outBuffer,
int outByteOffset,
int inFrameCount)
Override this method to do the actual conversion.
|
protected void |
convert(FloatSampleBuffer buffer,
int offset,
int count)
Override this method to do the actual conversion in the
FloatSampleBuffer.
|
protected void |
convertInPlace(byte[] buffer,
int byteOffset,
int frameCount)
Override this method to provide in-place conversion of samples.
|
protected boolean |
enableConvertInPlace()
descendant classes should call this method if they have implemented
convertInPlace().
|
protected void |
enableFloatConversion()
Descendant classes should call this method if they have implemented
convert(FloatSampleBuffer).
|
int |
getChannels() |
AudioFormat |
getOriginalFormat() |
AudioInputStream |
getOriginalStream() |
float |
getSampleRate() |
boolean |
isDone()
Determine if this stream has reached its end.
|
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] abData,
int nOffset,
int nLength)
Read nLength bytes that will be the converted samples
of the original InputStream.
|
void |
read(FloatSampleBuffer buffer)
Fill the entire buffer with audio data.
|
void |
read(FloatSampleBuffer buffer,
int offset,
int sampleCount)
read sampleCount converted samples at the specified offset.
|
void |
reset() |
long |
skip(long nSkip) |
properties, setPropertygetFormat, getFrameLength, readprotected byte[] m_buffer
public TSynchronousFilteredAudioInputStream(AudioInputStream audioInputStream, AudioFormat newFormat)
protected boolean enableConvertInPlace()
protected void enableFloatConversion()
protected abstract int convert(byte[] inBuffer,
byte[] outBuffer,
int outByteOffset,
int inFrameCount)
protected void convertInPlace(byte[] buffer,
int byteOffset,
int frameCount)
protected void convert(FloatSampleBuffer buffer, int offset, int count)
buffer - the buffer to convertoffset - the offset in buffer in samplescount - the number of samples in buffer to convertpublic int read()
throws IOException
read in class AudioInputStreamIOExceptionpublic AudioInputStream getOriginalStream()
public AudioFormat getOriginalFormat()
public final int read(byte[] abData,
int nOffset,
int nLength)
throws IOException
read in class AudioInputStreamIOExceptionpublic long skip(long nSkip)
throws IOException
skip in class AudioInputStreamIOExceptionpublic int available()
throws IOException
available in class AudioInputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class AudioInputStreamIOExceptionpublic void mark(int readlimit)
mark in class AudioInputStreampublic void reset()
throws IOException
reset in class AudioInputStreamIOExceptionpublic boolean markSupported()
markSupported in class AudioInputStreampublic int getChannels()
getChannels in interface FloatSampleInputpublic float getSampleRate()
getSampleRate in interface FloatSampleInputpublic boolean isDone()
FloatSampleInputisDone in interface FloatSampleInputpublic void read(FloatSampleBuffer buffer, int offset, int sampleCount)
read in interface FloatSampleInputbuffer - the buffer to be filledoffset - the start index, in samples, where to start filling the
buffersampleCount - the number fo samples to fill into the bufferpublic void read(FloatSampleBuffer buffer)
FloatSampleInputThe buffer's channel count and sample rate may not be changed by the implementation of this method.
read in interface FloatSampleInputbuffer - the buffer to be filledCopyright © 2016. All Rights Reserved.