本文整理汇总了Java中org.lwjgl.openal.EFX10.alAuxiliaryEffectSloti方法的典型用法代码示例。如果您正苦于以下问题:Java EFX10.alAuxiliaryEffectSloti方法的具体用法?Java EFX10.alAuxiliaryEffectSloti怎么用?Java EFX10.alAuxiliaryEffectSloti使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.openal.EFX10
的用法示例。
在下文中一共展示了EFX10.alAuxiliaryEffectSloti方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setEnvironment
import org.lwjgl.openal.EFX10; //导入方法依赖的package包/类
public void setEnvironment(Environment env){
checkDead();
synchronized (threadLock){
while (!threadLock.get()){
try {
threadLock.wait();
} catch (InterruptedException ex) {
}
}
if (audioDisabled)
return;
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_DENSITY, env.getDensity());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_DIFFUSION, env.getDiffusion());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_GAIN, env.getGain());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_GAINHF, env.getGainHf());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_DECAY_TIME, env.getDecayTime());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_DECAY_HFRATIO, env.getDecayHFRatio());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_REFLECTIONS_GAIN, env.getReflectGain());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_REFLECTIONS_DELAY, env.getReflectDelay());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_LATE_REVERB_GAIN, env.getLateReverbGain());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_LATE_REVERB_DELAY, env.getLateReverbDelay());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_AIR_ABSORPTION_GAINHF, env.getAirAbsorbGainHf());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_ROOM_ROLLOFF_FACTOR, env.getRoomRolloffFactor());
// attach effect to slot
EFX10.alAuxiliaryEffectSloti(reverbFxSlot, EFX10.AL_EFFECTSLOT_EFFECT, reverbFx);
}
}
示例2: setEnvironment
import org.lwjgl.openal.EFX10; //导入方法依赖的package包/类
public void setEnvironment(Environment env){
checkDead();
synchronized (threadLock){
while (!threadLock.get()){
try {
threadLock.wait();
} catch (InterruptedException ex) {
}
}
if (audioDisabled || !supportEfx)
return;
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_DENSITY, env.getDensity());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_DIFFUSION, env.getDiffusion());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_GAIN, env.getGain());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_GAINHF, env.getGainHf());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_DECAY_TIME, env.getDecayTime());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_DECAY_HFRATIO, env.getDecayHFRatio());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_REFLECTIONS_GAIN, env.getReflectGain());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_REFLECTIONS_DELAY, env.getReflectDelay());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_LATE_REVERB_GAIN, env.getLateReverbGain());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_LATE_REVERB_DELAY, env.getLateReverbDelay());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_AIR_ABSORPTION_GAINHF, env.getAirAbsorbGainHf());
EFX10.alEffectf(reverbFx, EFX10.AL_REVERB_ROOM_ROLLOFF_FACTOR, env.getRoomRolloffFactor());
// attach effect to slot
EFX10.alAuxiliaryEffectSloti(reverbFxSlot, EFX10.AL_EFFECTSLOT_EFFECT, reverbFx);
}
}
示例3: setupEFX
import org.lwjgl.openal.EFX10; //导入方法依赖的package包/类
private static void setupEFX()
{
//Get current context and device
ALCcontext currentContext = ALC10.alcGetCurrentContext();
ALCdevice currentDevice = ALC10.alcGetContextsDevice(currentContext);
if (ALC10.alcIsExtensionPresent(currentDevice, "ALC_EXT_EFX"))
{
log("EFX Extension recognized.");
}
else
{
logError("EFX Extension not found on current device. Aborting.");
return;
}
//Create auxiliary effect slots
auxFXSlot0 = EFX10.alGenAuxiliaryEffectSlots();
log("Aux slot " + auxFXSlot0 + " created");
EFX10.alAuxiliaryEffectSloti(auxFXSlot0, EFX10.AL_EFFECTSLOT_AUXILIARY_SEND_AUTO, AL10.AL_TRUE);
auxFXSlot1 = EFX10.alGenAuxiliaryEffectSlots();
log("Aux slot " + auxFXSlot1 + " created");
EFX10.alAuxiliaryEffectSloti(auxFXSlot1, EFX10.AL_EFFECTSLOT_AUXILIARY_SEND_AUTO, AL10.AL_TRUE);
auxFXSlot2 = EFX10.alGenAuxiliaryEffectSlots();
log("Aux slot " + auxFXSlot2 + " created");
EFX10.alAuxiliaryEffectSloti(auxFXSlot2, EFX10.AL_EFFECTSLOT_AUXILIARY_SEND_AUTO, AL10.AL_TRUE);
auxFXSlot3 = EFX10.alGenAuxiliaryEffectSlots();
log("Aux slot " + auxFXSlot3 + " created");
EFX10.alAuxiliaryEffectSloti(auxFXSlot3, EFX10.AL_EFFECTSLOT_AUXILIARY_SEND_AUTO, AL10.AL_TRUE);
checkErrorLog("Failed creating auxiliary effect slots!");
//Create effect objects
reverb0 = EFX10.alGenEffects(); //Create effect object
EFX10.alEffecti(reverb0, EFX10.AL_EFFECT_TYPE, EFX10.AL_EFFECT_EAXREVERB); //Set effect object to be reverb
checkErrorLog("Failed creating reverb effect slot 0!");
reverb1 = EFX10.alGenEffects(); //Create effect object
EFX10.alEffecti(reverb1, EFX10.AL_EFFECT_TYPE, EFX10.AL_EFFECT_EAXREVERB); //Set effect object to be reverb
checkErrorLog("Failed creating reverb effect slot 1!");
reverb2 = EFX10.alGenEffects(); //Create effect object
EFX10.alEffecti(reverb2, EFX10.AL_EFFECT_TYPE, EFX10.AL_EFFECT_EAXREVERB); //Set effect object to be reverb
checkErrorLog("Failed creating reverb effect slot 2!");
reverb3 = EFX10.alGenEffects(); //Create effect object
EFX10.alEffecti(reverb3, EFX10.AL_EFFECT_TYPE, EFX10.AL_EFFECT_EAXREVERB); //Set effect object to be reverb
checkErrorLog("Failed creating reverb effect slot 3!");
//Create filters
directFilter0 = EFX10.alGenFilters();
EFX10.alFilteri(directFilter0, EFX10.AL_FILTER_TYPE, EFX10.AL_FILTER_LOWPASS);
sendFilter0 = EFX10.alGenFilters();
EFX10.alFilteri(sendFilter0, EFX10.AL_FILTER_TYPE, EFX10.AL_FILTER_LOWPASS);
sendFilter1 = EFX10.alGenFilters();
EFX10.alFilteri(sendFilter1, EFX10.AL_FILTER_TYPE, EFX10.AL_FILTER_LOWPASS);
sendFilter2 = EFX10.alGenFilters();
EFX10.alFilteri(sendFilter2, EFX10.AL_FILTER_TYPE, EFX10.AL_FILTER_LOWPASS);
sendFilter3 = EFX10.alGenFilters();
EFX10.alFilteri(sendFilter3, EFX10.AL_FILTER_TYPE, EFX10.AL_FILTER_LOWPASS);
checkErrorLog("Error creating lowpass filters!");
applyConfigChanges();
//setReverbParams(ReverbParams.getReverb0(), auxFXSlot0, reverb0); //Set the global reverb parameters and apply them to the effect and effectslot
//setReverbParams(ReverbParams.getReverb1(), auxFXSlot1, reverb1); //Set the global reverb parameters and apply them to the effect and effectslot
//setReverbParams(ReverbParams.getReverb2(), auxFXSlot2, reverb2); //Set the global reverb parameters and apply them to the effect and effectslot
//setReverbParams(ReverbParams.getReverb3(), auxFXSlot3, reverb3); //Set the global reverb parameters and apply them to the effect and effectslot
}
示例4: setReverbParams
import org.lwjgl.openal.EFX10; //导入方法依赖的package包/类
/**
* Applies the parameters in the enum ReverbParams to the main reverb effect.
*/
protected static void setReverbParams(ReverbParams r, int auxFXSlot, int reverbSlot)
{
/*
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_DECAY_TIME, r.decayTime); //Set default parameters
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_DENSITY, r.density);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_DIFFUSION, r.diffusion);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_GAIN, r.gain);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_GAINHF, r.gainHF);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_DECAY_HFRATIO, r.decayHFRatio);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_REFLECTIONS_GAIN, r.reflectionsGain);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_REFLECTIONS_DELAY, r.reflectionsDelay);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_LATE_REVERB_GAIN, r.lateReverbGain);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_LATE_REVERB_DELAY, r.lateReverbDelay);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_AIR_ABSORPTION_GAINHF, r.airAbsorptionGainHF);
EFX10.alEffectf(reverbSlot, EFX10.AL_REVERB_ROOM_ROLLOFF_FACTOR, r.roomRolloffFactor);
EFX10.alEffecti(reverbSlot, EFX10.AL_REVERB_DECAY_HFLIMIT, AL10.AL_TRUE);
*/
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_DENSITY, r.density); //Set default parameters
checkErrorLog("Error while assigning reverb density: " + r.density);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_DIFFUSION, r.diffusion); //Set default parameters
checkErrorLog("Error while assigning reverb diffusion: " + r.diffusion);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_GAIN, r.gain); //Set default parameters
checkErrorLog("Error while assigning reverb gain: " + r.gain);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_GAINHF, r.gainHF); //Set default parameters
checkErrorLog("Error while assigning reverb gainHF: " + r.gainHF);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_DECAY_TIME, r.decayTime); //Set default parameters
checkErrorLog("Error while assigning reverb decayTime: " + r.decayTime);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_DECAY_HFRATIO, r.decayHFRatio); //Set default parameters
checkErrorLog("Error while assigning reverb decayHFRatio: " + r.decayHFRatio);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_REFLECTIONS_GAIN, r.reflectionsGain); //Set default parameters
checkErrorLog("Error while assigning reverb reflectionsGain: " + r.reflectionsGain);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_LATE_REVERB_GAIN, r.lateReverbGain); //Set default parameters
checkErrorLog("Error while assigning reverb lateReverbGain: " + r.lateReverbGain);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_LATE_REVERB_DELAY, r.lateReverbDelay); //Set default parameters
checkErrorLog("Error while assigning reverb lateReverbDelay: " + r.lateReverbDelay);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_AIR_ABSORPTION_GAINHF, r.airAbsorptionGainHF); //Set default parameters
checkErrorLog("Error while assigning reverb airAbsorptionGainHF: " + r.airAbsorptionGainHF);
EFX10.alEffectf(reverbSlot, EFX10.AL_EAXREVERB_ROOM_ROLLOFF_FACTOR, r.roomRolloffFactor); //Set default parameters
checkErrorLog("Error while assigning reverb roomRolloffFactor: " + r.roomRolloffFactor);
//Attach updated effect object
EFX10.alAuxiliaryEffectSloti(auxFXSlot, EFX10.AL_EFFECTSLOT_EFFECT, reverbSlot);
}
示例5: playbackTest
import org.lwjgl.openal.EFX10; //导入方法依赖的package包/类
/**
* Plays a sound with various effects applied to it.
*/
private static void playbackTest() throws Exception {
setupEfx();
// Create a source and buffer audio data
final int source = AL10.alGenSources();
final int buffer = AL10.alGenBuffers();
WaveData waveFile = WaveData.create("Footsteps.wav");
if (waveFile == null) {
System.out.println("Failed to load Footsteps.wav! Skipping playback test.");
AL.destroy();
return;
}
AL10.alBufferData(buffer, waveFile.format, waveFile.data, waveFile.samplerate);
waveFile.dispose();
AL10.alSourcei(source, AL10.AL_BUFFER, buffer);
AL10.alSourcei(source, AL10.AL_LOOPING, AL10.AL_TRUE);
System.out.println("Playing sound unaffected by EFX ...");
AL10.alSourcePlay(source);
Thread.sleep(7500);
// Add reverb effect
final int effectSlot = EFX10.alGenAuxiliaryEffectSlots();
final int reverbEffect = EFX10.alGenEffects();
EFX10.alEffecti(reverbEffect, EFX10.AL_EFFECT_TYPE, EFX10.AL_EFFECT_REVERB);
EFX10.alEffectf(reverbEffect, EFX10.AL_REVERB_DECAY_TIME, 5.0f);
EFX10.alAuxiliaryEffectSloti(effectSlot, EFX10.AL_EFFECTSLOT_EFFECT, reverbEffect);
AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, effectSlot, 0,
EFX10.AL_FILTER_NULL);
System.out.println("Playing sound with reverb ...");
AL10.alSourcePlay(source);
Thread.sleep(7500);
// Add low-pass filter directly to source
final int filter = EFX10.alGenFilters();
EFX10.alFilteri(filter, EFX10.AL_FILTER_TYPE, EFX10.AL_FILTER_LOWPASS);
EFX10.alFilterf(filter, EFX10.AL_LOWPASS_GAIN, 0.5f);
EFX10.alFilterf(filter, EFX10.AL_LOWPASS_GAINHF, 0.5f);
AL10.alSourcei(source, EFX10.AL_DIRECT_FILTER, filter);
System.out.println("Playing sound with reverb and direct low pass filter ...");
AL10.alSourcePlay(source);
Thread.sleep(7500);
AL10.alSourcei(source, EFX10.AL_DIRECT_FILTER, EFX10.AL_FILTER_NULL);
// Add low-pass filter to source send
//AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, effectSlot, 0, filter);
//
//System.out.println("Playing sound with reverb and aux send low pass filter ...");
//AL10.alSourcePlay(source);
//Thread.sleep(7500);
// Cleanup
AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, EFX10.AL_EFFECTSLOT_NULL, 0,
EFX10.AL_FILTER_NULL);
EFX10.alAuxiliaryEffectSloti(effectSlot, EFX10.AL_EFFECTSLOT_EFFECT, EFX10.AL_EFFECT_NULL);
EFX10.alDeleteEffects(reverbEffect);
EFX10.alDeleteFilters(filter);
// Echo effect
final int echoEffect = EFX10.alGenEffects();
EFX10.alEffecti(echoEffect, EFX10.AL_EFFECT_TYPE, EFX10.AL_EFFECT_ECHO);
//EFX10.alEffectf(echoEffect, EFX10.AL_ECHO_DELAY, 5.0f);
EFX10.alAuxiliaryEffectSloti(effectSlot, EFX10.AL_EFFECTSLOT_EFFECT, echoEffect);
AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, effectSlot, 0,
EFX10.AL_FILTER_NULL);
System.out.println("Playing sound with echo effect ...");
AL10.alSourcePlay(source);
Thread.sleep(7500);
AL.destroy();
}