本文整理汇总了Java中org.lwjgl.openal.EFX10.alDeleteEffects方法的典型用法代码示例。如果您正苦于以下问题:Java EFX10.alDeleteEffects方法的具体用法?Java EFX10.alDeleteEffects怎么用?Java EFX10.alDeleteEffects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.openal.EFX10
的用法示例。
在下文中一共展示了EFX10.alDeleteEffects方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanupInThread
import org.lwjgl.openal.EFX10; //导入方法依赖的package包/类
public void cleanupInThread(){
if (audioDisabled){
AL.destroy();
return;
}
// delete channel-based sources
ib.clear();
ib.put(channels);
ib.flip();
alDeleteSources(ib);
if (supportEfx){
ib.position(0).limit(1);
ib.put(0, reverbFx);
EFX10.alDeleteEffects(ib);
ib.position(0).limit(1);
ib.put(0, reverbFxSlot);
EFX10.alDeleteAuxiliaryEffectSlots(ib);
}
// XXX: Delete other buffers/sources
AL.destroy();
}
示例2: cleanupInThread
import org.lwjgl.openal.EFX10; //导入方法依赖的package包/类
public void cleanupInThread(){
if (audioDisabled){
AL.destroy();
return;
}
// stop any playing channels
for (int i = 0; i < chanSrcs.length; i++){
if (chanSrcs[i] != null){
clearChannel(i);
}
}
// delete channel-based sources
ib.clear();
ib.put(channels);
ib.flip();
alDeleteSources(ib);
// delete audio buffers and filters
objManager.deleteAllObjects(this);
if (supportEfx){
ib.position(0).limit(1);
ib.put(0, reverbFx);
EFX10.alDeleteEffects(ib);
// If this is not allocated, why is it deleted?
// Commented out to fix native crash in OpenAL.
ib.position(0).limit(1);
ib.put(0, reverbFxSlot);
EFX10.alDeleteAuxiliaryEffectSlots(ib);
}
AL.destroy();
}
示例3: 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();
}