Class LowPassFilter

All Implemented Interfaces:
Savable, JmeCloneable, Cloneable

public class LowPassFilter extends Filter
A filter that attenuates frequencies above a specified threshold, allowing lower frequencies to pass through with less attenuation. Commonly used to simulate effects such as muffling or underwater acoustics.
  • Field Details Link icon

    • volume Link icon

      protected float volume
      The overall volume scaling of the filtered sound
    • highFreqVolume Link icon

      protected float highFreqVolume
      The volume scaling of the high frequencies allowed to pass through. Valid values range from 0.0 to 1.0, where 0.0 completely eliminates high frequencies and 1.0 lets them pass through unchanged.
  • Constructor Details Link icon

    • LowPassFilter Link icon

      public LowPassFilter()
      Constructs a low-pass filter with default settings. Required for jME deserialization.
    • LowPassFilter Link icon

      public LowPassFilter(float volume, float highFreqVolume)
      Constructs a low-pass filter.
      Parameters:
      volume - the overall volume scaling of the filtered sound (0.0 - 1.0).
      highFreqVolume - the volume scaling of high frequencies (0.0 - 1.0).
      Throws:
      IllegalArgumentException - if volume or highFreqVolume is out of range.
    • LowPassFilter Link icon

      protected LowPassFilter(int id)
      For internal cloning
      Parameters:
      id - the native object ID
  • Method Details Link icon

    • getHighFreqVolume Link icon

      public float getHighFreqVolume()
      Retrieves the current volume scaling of high frequencies.
      Returns:
      the high-frequency volume scaling.
    • setHighFreqVolume Link icon

      public void setHighFreqVolume(float highFreqVolume)
      Sets the high-frequency volume.
      Parameters:
      highFreqVolume - the new high-frequency volume scaling (0.0 - 1.0).
      Throws:
      IllegalArgumentException - if highFreqVolume is out of range.
    • getVolume Link icon

      public float getVolume()
      Retrieves the current overall volume scaling of the filtered sound.
      Returns:
      the overall volume scaling.
    • setVolume Link icon

      public void setVolume(float volume)
      Sets the overall volume.
      Parameters:
      volume - the new overall volume scaling (0.0 - 1.0).
      Throws:
      IllegalArgumentException - if volume is out of range.
    • write Link icon

      public void write(JmeExporter ex) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class Filter
      Throws:
      IOException
    • read Link icon

      public void read(JmeImporter im) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class Filter
      Throws:
      IOException
    • createDestructableClone Link icon

      public NativeObject createDestructableClone()
      Creates a native object clone of this filter for internal usage.
      Specified by:
      createDestructableClone in class Filter
      Returns:
      a new LowPassFilter instance with the same native ID.
    • getUniqueId Link icon

      public long getUniqueId()
      Retrieves a unique identifier for this filter. Used internally for native object management.
      Specified by:
      getUniqueId in class NativeObject
      Returns:
      a unique long identifier.