|
|||||||||
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.FloatInputStream
public class FloatInputStream
An implementation of AudioInputStream that implements the FloatSampleInput interface. This is a convenience class to instantly make any AudioInputStream capable of fulfilling the FloatSampleInput interface, or vice versa: make an existing FloatSampleInput class compatible with AudioInputStream.
All calls to FloatSampleInput.read() will cause implicit conversion to FloatSampleBuffer. If the underlying stream implementes FloatSampleInput, the FloatSampleInput.read method is used for reading.
Constructor Summary | |
---|---|
FloatInputStream(AudioInputStream sourceStream)
Create a new FloatInputStream that shadows the sourceStream. |
|
FloatInputStream(FloatSampleInput sourceInput,
AudioFormat format,
long frameLength)
Create a new FloatInputStream that will make the specified FloatSampleInput a complete AudioInputStream. |
|
FloatInputStream(java.io.InputStream sourceStream,
AudioFormat format,
long frameLength)
Create a new FloatInputStream that shadows the sourceStream. |
Method Summary | |
---|---|
int |
available()
|
void |
close()
|
int |
getChannels()
|
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 |
read(byte[] abData,
int nOffset,
int nLength)
If an underlying InputStream is available, read from it, otherwise read from an underlying FloatSampleInput stream and convert to a byte array. |
void |
read(FloatSampleBuffer outBuffer)
Fill the entire buffer with audio data. |
void |
read(FloatSampleBuffer buffer,
int offset,
int sampleCount)
Fill the specified portion of the buffer with the next audio data to be read. |
void |
reset()
|
long |
skip(long nSkip)
|
Methods inherited from class javax.sound.sampled.AudioInputStream |
---|
getFormat, getFrameLength |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FloatInputStream(AudioInputStream sourceStream)
sourceStream
-
java.lang.IllegalArgumentException
- if the stream's format is not compatiblepublic FloatInputStream(java.io.InputStream sourceStream, AudioFormat format, long frameLength)
sourceStream
- format
- the native format of sourceStreamframeLength
- the length in frames of the streams, or
AudioSystem.NOT_SPECIFIED if not known or unlimited.
java.lang.IllegalArgumentException
- if the stream's format is not compatiblepublic FloatInputStream(FloatSampleInput sourceInput, AudioFormat format, long frameLength)
sourceInput
- format
- the native format for the read(byte[]) methodframeLength
- the length in frames of the stream, or
AudioSystem.NOT_SPECIFIED if not known or unlimited.
java.lang.IllegalArgumentException
- if the format is not compatibleMethod Detail |
---|
public void read(FloatSampleBuffer outBuffer)
FloatSampleInput
The buffer's channel count and sample rate may not be changed by the implementation of this method.
read
in interface FloatSampleInput
outBuffer
- the buffer to be filledpublic void read(FloatSampleBuffer buffer, int offset, int sampleCount)
FloatSampleInput
offset
.
The buffer's channel count and sample rate may not be changed by the implementation of this method.
read
in interface FloatSampleInput
buffer
- 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 int getChannels()
getChannels
in interface FloatSampleInput
public float getSampleRate()
getSampleRate
in interface FloatSampleInput
public boolean isDone()
FloatSampleInput
isDone
in interface FloatSampleInput
public int read() throws java.io.IOException
read
in class AudioInputStream
java.io.IOException
public int read(byte[] abData) throws java.io.IOException
read
in class AudioInputStream
java.io.IOException
read(byte[], int, int)
public int read(byte[] abData, int nOffset, int nLength) throws java.io.IOException
read
in class AudioInputStream
java.io.IOException
public long skip(long nSkip) throws java.io.IOException
skip
in class AudioInputStream
java.io.IOException
public int available() throws java.io.IOException
available
in class AudioInputStream
java.io.IOException
public void mark(int readlimit)
mark
in class AudioInputStream
public void reset() throws java.io.IOException
reset
in class AudioInputStream
java.io.IOException
public boolean markSupported()
markSupported
in class AudioInputStream
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class AudioInputStream
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |