|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.sound.audio.streamAudioFilter.StreamAudioFilter
org.deken.game.sound.audio.streamAudioFilter.EchoStreamFilter
public class EchoStreamFilter
Title: EchoFilter
Description: This class is a SoundFilter that emulates an echo.
FilteredSoundStream
Constructor Summary | |
---|---|
EchoStreamFilter(javax.sound.sampled.AudioInputStream inputStream)
|
|
EchoStreamFilter(int numDelaySamples,
float decay)
EchoFilter |
Method Summary | |
---|---|
void |
filter(byte[] samples,
int offset,
int length)
filter |
int |
getRemainingSize()
getRemainingSize |
void |
reset()
reset |
Methods inherited from class org.deken.game.sound.audio.streamAudioFilter.StreamAudioFilter |
---|
filter, getSample, setAudioFormat, setSample |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EchoStreamFilter(int numDelaySamples, float decay)
Creates an EchoFilter with the specified number of delay samples and the specified decay rate.
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.
numDelaySamples
- intdecay
- floatpublic EchoStreamFilter(javax.sound.sampled.AudioInputStream inputStream)
Method Detail |
---|
public int getRemainingSize()
Gets the remaining size, in bytes, of samples that this filter can echo after the sound is done playing.
Ensures that the sound will have decayed to below 1% of maximum volume (amplitude).
getRemainingSize
in class StreamAudioFilter
public void reset()
Clears this EchoFilter's internal delay buffer.
reset
in class StreamAudioFilter
public void filter(byte[] samples, int offset, int length)
Filters the sound samples to add an echo. The samples played are added to the sound in the delay buffer multiplied by the decay rate. The result is then stored in the delay buffer, so multiple echoes are heard.
filter
in class StreamAudioFilter
samples
- byte[]offset
- intlength
- int
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |