|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.paris.lutece.plugins.captcha.modules.jcaptcha.service.sound.filter.SoundFilter
public abstract class SoundFilter
A abstract class designed to filter sound samples. Since SoundFilters may use internal buffering of samples, a new SoundFilter object should be created for every sound played. However, SoundFilters can be reused after they are finished by called the reset() method.
FilteredSoundStream
Field Summary | |
---|---|
protected static int |
SAMPLE_SIZE_16_BIT
|
protected static int |
SAMPLE_SIZE_8_BIT
|
Constructor Summary | |
---|---|
SoundFilter()
|
Method Summary | |
---|---|
abstract void |
filter(byte[] samples,
int offset,
int length,
int sampleSizeInBits)
Filters an array of samples. |
static short |
get16bitSample(byte[] buffer,
int position)
Convenience method for getting a 16-bit sample from a byte array. |
static short |
get8bitSample(byte[] buffer,
int position)
Convenience method for getting a 8-bit sample from a byte array. |
AudioFormat |
getAudioFormat(AudioInputStream audioInputStream)
Return the audio format corresponding to the input stream Overrided by the filters that mofify AudioFormat |
int |
getRemainingSize()
Gets the remaining size, in bytes, that this filter plays after the sound is finished. |
void |
reset()
Resets this SoundFilter. |
static void |
set16bitSample(byte[] buffer,
int position,
short sample)
Convenience method for setting a 16-bit sample in a byte array. |
static void |
set8bitSample(byte[] buffer,
int position,
short sample)
Convenience method for setting a 8-bit sample in a byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int SAMPLE_SIZE_16_BIT
protected static final int SAMPLE_SIZE_8_BIT
Constructor Detail |
---|
public SoundFilter()
Method Detail |
---|
public void reset()
public int getRemainingSize()
public abstract void filter(byte[] samples, int offset, int length, int sampleSizeInBits)
samples
- the samplesoffset
- the offsetlength
- the lengthsampleSizeInBits
- the sample size in bitspublic static short get8bitSample(byte[] buffer, int position)
buffer
- the bufferposition
- the position
public static void set8bitSample(byte[] buffer, int position, short sample)
buffer
- the bufferposition
- the positionsample
- the samplepublic static short get16bitSample(byte[] buffer, int position)
buffer
- the bufferposition
- the position
public static void set16bitSample(byte[] buffer, int position, short sample)
buffer
- the bufferposition
- the positionsample
- the samplepublic AudioFormat getAudioFormat(AudioInputStream audioInputStream)
audioInputStream
- the audio input stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |