Package com.jme3.audio
Class Environment
java.lang.Object
com.jme3.audio.Environment
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Environment
static final Environment
static final Environment
static final Environment
static final Environment
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, defaultEnvironment
.Environment
(float[] e) Creates a newEnvironment
by interpreting an array of 28 float values as an EAX preset.Environment
(float density, float diffusion, float gain, float gainHf, float decayTime, float decayHf, float reflectGain, float reflectDelay, float lateGain, float lateDelay) Creates a newEnvironment
with the specified parameters.Environment
(Environment source) Creates a newEnvironment
as a copy of the providedEnvironment
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
float
float
float
float
float
float
getGain()
float
float
float
float
float
float
int
hashCode()
boolean
void
setAirAbsorbGainHf
(float airAbsorbGainHf) void
setDecayHfLimit
(boolean decayHfLimit) void
setDecayHFRatio
(float decayHFRatio) void
setDecayTime
(float decayTime) void
setDensity
(float density) void
setDiffusion
(float diffusion) void
setGain
(float gain) void
setGainHf
(float gainHf) void
setLateReverbDelay
(float lateReverbDelay) void
setLateReverbGain
(float lateReverbGain) void
setReflectDelay
(float reflectDelay) void
setReflectGain
(float reflectGain) void
setRoomRolloffFactor
(float roomRolloffFactor)
-
Field Details
-
Garage
-
Dungeon
-
Cavern
-
AcousticLab
-
Closet
-
-
Constructor Details
-
Environment
public Environment()Constructs a new, defaultEnvironment
. The default values are typically chosen to represent a neutral or common acoustic space. -
Environment
Creates a newEnvironment
as a copy of the providedEnvironment
.- Parameters:
source
- TheEnvironment
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 newEnvironment
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 newEnvironment
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
-
hashCode
public int hashCode()
-