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.
|
long |
skip(long bytesToSkip)
Skip a number of bytes before reading the remaining bytes.
|
public UniversalAudioInputStream(java.io.InputStream underlyingInputStream, TarsosDSPAudioFormat format)
public long skip(long bytesToSkip) throws java.io.IOException
TarsosDSPAudioInputStream
skip
in interface TarsosDSPAudioInputStream
bytesToSkip
- The number of bytes to skip.java.io.IOException
- If the underlying if an input or output error occurs
#see readpublic 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