Class SoundEffect
java.lang.Object
de.pottgames.tuningfork.SoundEffect
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
A sound effect that can be attached to a sound source via
SoundSource.attachEffect(SoundEffect). It uses native resources, call dispose()
when you don't need it anymore.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSoundEffect(SoundEffectData data) Creates a new SoundEffect from a template. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Releases all resources of this effect and detaches it from every sound source it is attached to.booleangetAttachedSources(com.badlogic.gdx.utils.Array<SoundSource> saveToList) Saves allSoundSources that this SoundEffect is currently attached to in the list specified in the parameter.booleanReturns true if this sound effect is attached to one or more sources.voidsetEnvironmental(boolean value) Sets whether this effect should be automtically adjusted by source and listener position.voidupdateEffect(SoundEffectData data) Updates the sound effect data.
-
Constructor Details
-
SoundEffect
Creates a new SoundEffect from a template.- Parameters:
data- Available effects:AutoWah,Chorus,Compressor,Distortion,EaxReverb,Echo,Equalizer,Flanger,FrequencyShifter,PitchShifter,Reverb,RingModulator,VocalMorpher.- See Also:
-
-
Method Details
-
updateEffect
Updates the sound effect data. This is also possible at runtime, when the sound effect is in active use.- Parameters:
data- Available effects:AutoWah,Chorus,Compressor,Distortion,EaxReverb,Echo,Equalizer,Flanger,FrequencyShifter,PitchShifter,Reverb,RingModulator,VocalMorpher.
-
setEnvironmental
public void setEnvironmental(boolean value) Sets whether this effect should be automtically adjusted by source and listener position. Enabling this leads to a more realistic impression of the environment. This property should be enabled when using a reverb effect to simulate the environment surrounding a listener or a source.- Parameters:
value- whether this effect should be environmental or "pure"
-
isAttached
public boolean isAttached()Returns true if this sound effect is attached to one or more sources.- Returns:
- true if attached, false otherwise
-
getAttachedSources
Saves allSoundSources that this SoundEffect is currently attached to in the list specified in the parameter.- Parameters:
saveToList- provide an array to save the sources to- Returns:
- true if the effect is attached to at least one source
-
dispose
public void dispose()Releases all resources of this effect and detaches it from every sound source it is attached to.- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-