public class MixingFloatAudioInputStream extends AudioInputStream
This class uses the FloatSampleBuffer for easy conversion using normalized samples in the buffers.
format, frameLength, framePos, frameSize
Constructor and Description |
---|
MixingFloatAudioInputStream(AudioFormat audioFormat,
AudioInputStream original,
AudioInputStream background,
float backgroundAttenuationFactor) |
Modifier and Type | Method and Description |
---|---|
int |
available()
The minimum of available() of all input stream is calculated and
returned.
|
void |
close() |
static float |
decibel2linear(float decibels) |
long |
getFrameLength()
The maximum of the frame length of the input stream is calculated and
returned.
|
void |
mark(int nReadLimit)
Calls mark() on all input streams.
|
boolean |
markSupported()
returns true if all input stream return true for markSupported().
|
int |
read() |
int |
read(byte[] abData,
int nOffset,
int nLength) |
void |
reset()
Calls reset() on all input streams.
|
long |
skip(long lLength)
calls skip() on all input streams.
|
getFormat, read
public MixingFloatAudioInputStream(AudioFormat audioFormat, AudioInputStream original, AudioInputStream background, float backgroundAttenuationFactor)
audioFormat
- the audio Formatoriginal
- the originalbackground
- the backgroundbackgroundAttenuationFactor
- the backgroundAttenuationFactorpublic long getFrameLength()
AudioInputStream.NOT_SPECIFIED
, this value is returned.getFrameLength
in class AudioInputStream
public int read() throws IOException
read
in class AudioInputStream
IOException
- the IOExceptionpublic int read(byte[] abData, int nOffset, int nLength) throws IOException
read
in class AudioInputStream
abData
- the DatanOffset
- the OffsetnLength
- the LengthIOException
- the IOExceptionpublic long skip(long lLength) throws IOException
skip
in class AudioInputStream
lLength
- the lengthIOException
- the IOExceptionpublic int available() throws IOException
available
in class AudioInputStream
IOException
- the IOExceptionpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class AudioInputStream
IOException
- the IOExceptionpublic void mark(int nReadLimit)
mark
in class AudioInputStream
nReadLimit
- the read limitpublic void reset() throws IOException
reset
in class AudioInputStream
IOException
- the IOExceptionpublic boolean markSupported()
markSupported
in class AudioInputStream
public static float decibel2linear(float decibels)
decibels
- the decibelsCopyright © 2018 City of Paris. All rights reserved.