public class StereoAudioInputStream extends AudioInputStream
Modifier and Type | Field and Description |
---|---|
protected int |
inputChannels |
protected AudioFormat |
newFormat |
protected int |
outputMode |
format, frameLength, framePos, frameSize
Constructor and Description |
---|
StereoAudioInputStream(AudioInputStream input) |
StereoAudioInputStream(AudioInputStream input,
int outputMode) |
Modifier and Type | Method and Description |
---|---|
int |
available()
Returns the maximum number of bytes that can be read (or skipped over) from this audio input stream without blocking.
|
AudioFormat |
getFormat() |
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 n)
Skips over and discards a specified number of bytes from this audio input stream.
|
close, getFrameLength, mark, markSupported, read, read, reset
protected int inputChannels
protected int outputMode
protected AudioFormat newFormat
public StereoAudioInputStream(AudioInputStream input)
public StereoAudioInputStream(AudioInputStream input, int outputMode)
input
- inputoutputMode
- as defined in AudioPlayer: STEREO, LEFT_ONLY or RIGHT_ONLY.public int read(byte[] b, int off, int len) throws IOException
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 class AudioInputStream
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 readIOException
- if an input or output error occursAudioInputStream.read(byte[])
,
AudioInputStream.read()
,
skip(long)
,
available()
public long skip(long n) throws IOException
skip
in class AudioInputStream
n
- the requested number of bytes to be skippedIOException
- if an input or output error occursread(byte[], int, int)
,
available()
public int available() throws IOException
read
or skip
method for this audio input stream;
the limit can vary each time these methods are invoked. Depending on the underlying stream,an IOException may be thrown if
this stream is closed.available
in class AudioInputStream
IOException
- if an input or output error occursread(byte[], int, int)
,
AudioInputStream.read(byte[])
,
AudioInputStream.read()
,
skip(long)
public AudioFormat getFormat()
getFormat
in class AudioInputStream
Copyright © 2000–2016 DFKI GmbH. All rights reserved.