|
||||||||||
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
fr.paris.lutece.plugins.captcha.modules.jcaptcha.service.sound.MixingFloatAudioInputStream
public class MixingFloatAudioInputStream
Mixing of multiple AudioInputStreams to one AudioInputStream. This class takes a collection of AudioInputStreams and mixes them together. Being a subclass of AudioInputStream itself, reading from instances of this class behaves as if the mixdown result of the input streams is read.
This class uses the FloatSampleBuffer for easy conversion using normalized samples in the buffers.
Field Summary |
---|
Fields inherited from class javax.sound.sampled.AudioInputStream |
---|
format, frameLength, framePos, frameSize |
Constructor Summary | |
---|---|
MixingFloatAudioInputStream(AudioFormat audioFormat,
AudioInputStream original,
AudioInputStream background,
float backgroundAttenuationFactor)
|
Method Summary | |
---|---|
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. |
Methods inherited from class javax.sound.sampled.AudioInputStream |
---|
getFormat, read |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MixingFloatAudioInputStream(AudioFormat audioFormat, AudioInputStream original, AudioInputStream background, float backgroundAttenuationFactor)
audioFormat
- the audio Formatoriginal
- the originalbackground
- the backgroundbackgroundAttenuationFactor
- the backgroundAttenuationFactorMethod Detail |
---|
public 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 Length
IOException
- the IOExceptionpublic long skip(long lLength) throws IOException
skip
in class AudioInputStream
lLength
- the length
IOException
- the IOExceptionpublic int available() throws IOException
available
in class AudioInputStream
IOException
- the IOExceptionpublic void close() throws IOException
close
in interface Closeable
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 decibels
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |