public class UniversalAudioInputStream extends java.lang.Object implements TarsosDSPAudioInputStream
Constructor and Description |
---|
UniversalAudioInputStream(java.io.InputStream underlyingInputStream,
TarsosDSPAudioFormat format) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this audio input stream and releases any system resources associated
with the stream.
|
TarsosDSPAudioFormat |
getFormat() |
long |
getFrameLength() |
int |
read(byte[] b,
int off,
int len)
Reads up to a specified maximum number of bytes of data from the audio
stream, putting them into the given byte array.
|
void |
skip(long bytesToSkip) |
public UniversalAudioInputStream(java.io.InputStream underlyingInputStream, TarsosDSPAudioFormat format)
public void skip(long bytesToSkip) throws java.io.IOException
skip
in interface TarsosDSPAudioInputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
TarsosDSPAudioInputStream
This method will always read an integral number of frames.
If len
does not specify an integral number
of frames, a maximum of len - (len % frameSize)
bytes will be read.
read
in interface TarsosDSPAudioInputStream
b
- the buffer into which the data is readoff
- the offset, from the beginning of array b
, at which
the data will be writtenlen
- the maximum number of bytes to readjava.io.IOException
- if an input or output error occursTarsosDSPAudioInputStream.skip(long)
public void close() throws java.io.IOException
TarsosDSPAudioInputStream
close
in interface TarsosDSPAudioInputStream
java.io.IOException
- if an input or output error occurspublic TarsosDSPAudioFormat getFormat()
getFormat
in interface TarsosDSPAudioInputStream
public long getFrameLength()
getFrameLength
in interface TarsosDSPAudioInputStream