public static class SampleRateConversionProvider.SampleRateConverterStream extends AudioInputStream implements FloatSampleInput
| Modifier and Type | Field and Description |
|---|---|
static int |
LINEAR_INTERPOLATION
Conversion algorithm
|
static int |
RESAMPLE
Conversion algorithm
|
static int |
SAMPLE_AND_HOLD
Conversion algorithm
|
| Constructor and Description |
|---|
SampleRateConversionProvider.SampleRateConverterStream(AudioInputStream sourceStream,
AudioFormat targetFormat) |
SampleRateConversionProvider.SampleRateConverterStream(FloatSampleInput sourceInput,
AudioFormat targetFormat,
long frameLength) |
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
void |
flush()
Flushes the internal buffers
|
int |
getChannels() |
int |
getConversionAlgorithm() |
int |
getFrameSize() |
float |
getSampleRate() |
int |
getSourceFrameSize() |
float |
getTargetSampleRate() |
boolean |
isClosed() |
boolean |
isDone()
Determine if this stream has reached its end.
|
void |
mark(int readlimit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] abData) |
int |
read(byte[] abData,
int nOffset,
int nLength)
Read nLength bytes that will be the converted samples of the original
inputStream.
|
void |
read(FloatSampleBuffer outBuffer)
Fill the entire buffer with audio data.
|
void |
read(FloatSampleBuffer outBuffer,
int offset,
int count)
Main read method.
|
void |
reset() |
void |
setConversionAlgorithm(int algo) |
void |
setTargetSampleRate(float sr) |
long |
skip(long nSkip) |
getFormat, getFrameLengthpublic static final int SAMPLE_AND_HOLD
public static final int LINEAR_INTERPOLATION
public static final int RESAMPLE
public SampleRateConversionProvider.SampleRateConverterStream(AudioInputStream sourceStream, AudioFormat targetFormat)
public SampleRateConversionProvider.SampleRateConverterStream(FloatSampleInput sourceInput, AudioFormat targetFormat, long frameLength)
public int getChannels()
getChannels in interface FloatSampleInputpublic float getSampleRate()
getSampleRate in interface FloatSampleInputpublic boolean isDone()
FloatSampleInputisDone in interface FloatSampleInputpublic void read(FloatSampleBuffer outBuffer)
FloatSampleInputThe buffer's channel count and sample rate may not be changed by the implementation of this method.
read in interface FloatSampleInputoutBuffer - the buffer to be filledpublic void read(FloatSampleBuffer outBuffer, int offset, int count)
conversionAlgorithm. At most
outBuffer.getSampleCount() are converted. In general, if
outBuffer.getSampleCount()) is less after processing this function,
then it is an indicator that it was the last block to be processed.read in interface FloatSampleInputoutBuffer - the buffer that the converted samples will be
written to.offset - the start index, in samples, where to start filling the
buffercount - the number fo samples to fill into the bufferjava.lang.IllegalArgumentException - when outBuffer's channel count does
not matchsetConversionAlgorithm(int)public int getFrameSize()
public int getSourceFrameSize()
public int read()
throws java.io.IOException
read in class AudioInputStreamjava.io.IOExceptionpublic int read(byte[] abData)
throws java.io.IOException
read in class AudioInputStreamjava.io.IOExceptionread(byte[], int, int)public int read(byte[] abData,
int nOffset,
int nLength)
throws java.io.IOException
read in class AudioInputStreamjava.io.IOExceptionpublic long skip(long nSkip)
throws java.io.IOException
skip in class AudioInputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class AudioInputStreamjava.io.IOExceptionpublic void mark(int readlimit)
mark in class AudioInputStreampublic void reset()
throws java.io.IOException
reset in class AudioInputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class AudioInputStreampublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class AudioInputStreampublic boolean isClosed()
public void flush()
public void setTargetSampleRate(float sr)
public void setConversionAlgorithm(int algo)
public float getTargetSampleRate()
public int getConversionAlgorithm()