|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
javax.sound.sampled.AudioInputStream
org.tritonus.share.sampled.convert.TAudioInputStream
org.tritonus.share.sampled.convert.TSynchronousFilteredAudioInputStream
public abstract class TSynchronousFilteredAudioInputStream
Base class for types of audio filter/converter that translate one frame to another frame.
It provides all the transformation of frame sizes.
It does NOT handle different sample rates of original stream and this stream !
| Field Summary | |
|---|---|
protected byte[] |
m_buffer
The intermediate buffer used during convert actions (if not convertInPlace is used). |
| Fields inherited from class javax.sound.sampled.AudioInputStream |
|---|
format, frameLength, framePos, frameSize, stream |
| Constructor Summary | |
|---|---|
TSynchronousFilteredAudioInputStream(AudioInputStream audioInputStream,
AudioFormat newFormat)
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class org.tritonus.share.sampled.convert.TAudioInputStream |
|---|
properties, setProperty |
| Methods inherited from class javax.sound.sampled.AudioInputStream |
|---|
getFormat, getFrameLength, read |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected byte[] m_buffer
| Constructor Detail |
|---|
public TSynchronousFilteredAudioInputStream(AudioInputStream audioInputStream,
AudioFormat newFormat)
| Method Detail |
|---|
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 convert
public 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 AudioInputStreamIOException
public long skip(long nSkip)
throws IOException
skip in class AudioInputStreamIOException
public int available()
throws IOException
available in class AudioInputStreamIOException
public void close()
throws IOException
close in interface Closeableclose in class AudioInputStreamIOExceptionpublic void mark(int readlimit)
mark in class AudioInputStream
public 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()
FloatSampleInput
isDone in interface FloatSampleInput
public 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 filled
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||