|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
javax.sound.sampled.AudioInputStream
org.tritonus.sampled.convert.SampleRateConversionProvider.SampleRateConverterStream
SampleRateConverterStream
Field Summary | |
---|---|
static int |
LINEAR_INTERPOLATION
Conversion algorithm |
static int |
RESAMPLE
Conversion algorithm |
static int |
SAMPLE_AND_HOLD
Conversion algorithm |
Fields inherited from class javax.sound.sampled.AudioInputStream |
---|
format, frameLength, framePos, frameSize, stream |
Constructor Summary | |
---|---|
SampleRateConversionProvider.SampleRateConverterStream(AudioInputStream sourceStream,
AudioFormat targetFormat)
|
Method Summary | |
---|---|
int |
available()
|
void |
close()
|
void |
flush()
Flushes the internal buffers |
int |
getConversionAlgorithm()
|
int |
getFrameSize()
|
int |
getSourceFrameSize()
|
float |
getTargetSampleRate()
|
boolean |
isClosed()
|
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. |
int |
read(FloatSampleBuffer outBuffer)
Main read method. |
void |
reset()
|
void |
setConversionAlgorithm(int algo)
|
void |
setTargetSampleRate(float sr)
|
long |
skip(long nSkip)
|
protected long |
sourceBytes2targetBytes(long sourceBytes)
|
protected double |
sourceFrames2targetFrames(double sourceFrames)
|
protected long |
targetBytes2sourceBytes(long targetBytes)
|
protected double |
targetFrames2sourceFrames(double targetFrames)
|
Methods inherited from class javax.sound.sampled.AudioInputStream |
---|
getFormat, getFrameLength |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SAMPLE_AND_HOLD
public static final int LINEAR_INTERPOLATION
public static final int RESAMPLE
Constructor Detail |
---|
public SampleRateConversionProvider.SampleRateConverterStream(AudioInputStream sourceStream, AudioFormat targetFormat)
Method Detail |
---|
public int read(FloatSampleBuffer outBuffer) throws IOException
conversionAlgorithm
.
At most outBuffer.getSampleCount() are converted. In general,
if the return value (and outBuffer.getSampleCount()) is less
after processing this function, then it is an indicator
that it was the last block to be processed.
outBuffer
- the buffer that the converted samples will be written to.
IllegalArgumentException
- when outBuffer's channel count does not match
IOException
setConversionAlgorithm(int)
protected double sourceFrames2targetFrames(double sourceFrames)
protected double targetFrames2sourceFrames(double targetFrames)
protected long sourceBytes2targetBytes(long sourceBytes)
protected long targetBytes2sourceBytes(long targetBytes)
public int getFrameSize()
public int getSourceFrameSize()
public int read() throws IOException
read
in class AudioInputStream
IOException
public int read(byte[] abData) throws IOException
read
in class AudioInputStream
IOException
read(byte[], int, int)
public int read(byte[] abData, int nOffset, int nLength) throws IOException
read
in class AudioInputStream
IOException
public long skip(long nSkip) throws IOException
skip
in class AudioInputStream
IOException
public int available() throws IOException
available
in class AudioInputStream
IOException
public void mark(int readlimit)
mark
in class AudioInputStream
public void reset() throws IOException
reset
in class AudioInputStream
IOException
public boolean markSupported()
markSupported
in class AudioInputStream
public void close() throws IOException
close
in interface Closeable
close
in class AudioInputStream
IOException
public boolean isClosed()
public void flush()
public void setTargetSampleRate(float sr)
public void setConversionAlgorithm(int algo)
public float getTargetSampleRate()
public int getConversionAlgorithm()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |