Class Environment

java.lang.Object
com.jme3.audio.Environment

public class Environment extends Object
Represents an audio environment, primarily used to define reverb effects. This class provides parameters that correspond to the properties controllable through the OpenAL EFX (Environmental Effects Extension) library. By adjusting these parameters, developers can simulate various acoustic spaces like rooms, caves, and concert halls, adding depth and realism to the audio experience.
  • Field Details

  • Constructor Details

    • Environment

      public Environment()
      Constructs a new, default Environment. The default values are typically chosen to represent a neutral or common acoustic space.
    • Environment

      public Environment(Environment source)
      Creates a new Environment as a copy of the provided Environment.
      Parameters:
      source - The Environment to copy the settings from.
    • Environment

      public Environment(float density, float diffusion, float gain, float gainHf, float decayTime, float decayHf, float reflectGain, float reflectDelay, float lateGain, float lateDelay)
      Creates a new Environment with the specified parameters. These parameters directly influence the properties of the reverb effect as managed by OpenAL EFX.
      Parameters:
      density - The density of the medium.
      diffusion - The diffusion of the reflections.
      gain - Overall gain applied to the environment effect.
      gainHf - High-frequency gain applied to the environment effect.
      decayTime - The overall decay time of the reflected sound.
      decayHf - Ratio of high-frequency decay time to the overall decay time.
      reflectGain - Gain applied to the initial reflections.
      reflectDelay - Delay time for the initial reflections.
      lateGain - Gain applied to the late reverberation.
      lateDelay - Delay time for the late reverberation.
    • Environment

      public Environment(float[] e)
      Creates a new Environment by interpreting an array of 28 float values as an EAX preset. This constructor attempts to map the EAX preset values to the corresponding OpenAL EFX parameters. Note that not all EAX parameters have a direct equivalent in standard OpenAL EFX, so some values might be approximated or ignored.
      Parameters:
      e - An array of 28 float values representing an EAX preset.
      Throws:
      IllegalArgumentException - If the provided array does not have a length of 28.
  • Method Details

    • getAirAbsorbGainHf

      public float getAirAbsorbGainHf()
    • setAirAbsorbGainHf

      public void setAirAbsorbGainHf(float airAbsorbGainHf)
    • getDecayHFRatio

      public float getDecayHFRatio()
    • setDecayHFRatio

      public void setDecayHFRatio(float decayHFRatio)
    • isDecayHfLimit

      public boolean isDecayHfLimit()
    • setDecayHfLimit

      public void setDecayHfLimit(boolean decayHfLimit)
    • getDecayTime

      public float getDecayTime()
    • setDecayTime

      public void setDecayTime(float decayTime)
    • getDensity

      public float getDensity()
    • setDensity

      public void setDensity(float density)
    • getDiffusion

      public float getDiffusion()
    • setDiffusion

      public void setDiffusion(float diffusion)
    • getGain

      public float getGain()
    • setGain

      public void setGain(float gain)
    • getGainHf

      public float getGainHf()
    • setGainHf

      public void setGainHf(float gainHf)
    • getLateReverbDelay

      public float getLateReverbDelay()
    • setLateReverbDelay

      public void setLateReverbDelay(float lateReverbDelay)
    • getLateReverbGain

      public float getLateReverbGain()
    • setLateReverbGain

      public void setLateReverbGain(float lateReverbGain)
    • getReflectDelay

      public float getReflectDelay()
    • setReflectDelay

      public void setReflectDelay(float reflectDelay)
    • getReflectGain

      public float getReflectGain()
    • setReflectGain

      public void setReflectGain(float reflectGain)
    • getRoomRolloffFactor

      public float getRoomRolloffFactor()
    • setRoomRolloffFactor

      public void setRoomRolloffFactor(float roomRolloffFactor)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object