public abstract class SoundFilter extends Object
FilteredSoundStream
Modifier and Type | Field and Description |
---|---|
protected static int |
SAMPLE_SIZE_16_BIT |
protected static int |
SAMPLE_SIZE_8_BIT |
Constructor and Description |
---|
SoundFilter() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected static final int SAMPLE_SIZE_16_BIT
protected static final int SAMPLE_SIZE_8_BIT
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 positionpublic 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 positionpublic static void set16bitSample(byte[] buffer, int position, short sample)
buffer
- the bufferposition
- the positionsample
- the samplepublic AudioFormat getAudioFormat(AudioInputStream audioInputStream)
audioInputStream
- the audio input streamCopyright © 2018 City of Paris. All rights reserved.