public class EchoFilter extends SoundFilter
SAMPLE_SIZE_16_BIT, SAMPLE_SIZE_8_BIT
Constructor and Description |
---|
EchoFilter(float echoDelay,
float decay)
Creates an EchoFilter with the specified number of delay samples and the
specified decay rate.
|
Modifier and Type | Method and Description |
---|---|
void |
filter(byte[] samples,
int offset,
int length,
int sampleSizeInBits)
Filters the sound samples to add an echo.
|
int |
getRemainingSize()
Gets the remaining size, in bytes, of samples that this filter can echo
after the sound is done playing.
|
void |
reset()
Clears this EchoFilter's internal delay buffer.
|
get16bitSample, get8bitSample, getAudioFormat, set16bitSample, set8bitSample
public EchoFilter(float echoDelay, float decay)
The number of delay samples specifies how long before the echo is initially heard. For a 1 second echo with mono, 44100Hz sound, use 44100 delay samples.
The decay value is how much the echo has decayed from the source. A decay value of .5 means the echo heard is half as loud as the source.
echoDelay
- the echoDelaydecay
- the decaypublic int getRemainingSize()
getRemainingSize
in class SoundFilter
public void reset()
reset
in class SoundFilter
public void filter(byte[] samples, int offset, int length, int sampleSizeInBits)
filter
in class SoundFilter
samples
- the samplesoffset
- the offsetlength
- the lengthsampleSizeInBits
- the sample size in bitsCopyright © 2018 City of Paris. All rights reserved.