Class SoundEffect

java.lang.Object
de.pottgames.tuningfork.SoundEffect
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class SoundEffect extends Object implements 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 Details

  • Method Details

    • updateEffect

      public void updateEffect(SoundEffectData data)
      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

      public boolean getAttachedSources(com.badlogic.gdx.utils.Array<SoundSource> saveToList)
      Saves all SoundSources 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:
      dispose in interface com.badlogic.gdx.utils.Disposable