diff --git a/doc/CREDITS b/doc/CREDITS index cf5afe2e..83c2c3bc 100644 --- a/doc/CREDITS +++ b/doc/CREDITS @@ -15,6 +15,7 @@ The following people have helped to make this project what it is today: - kappaOne - Simon Felix - Ryan McNally + - Ciardhubh additional credits goes to: - Joseph I. Valenzuela [OpenAL stuff] diff --git a/src/java/org/lwjgl/openal/AL.java b/src/java/org/lwjgl/openal/AL.java index b70a9265..1d98dde8 100644 --- a/src/java/org/lwjgl/openal/AL.java +++ b/src/java/org/lwjgl/openal/AL.java @@ -160,8 +160,9 @@ public final class AL { if(openDevice) { device = ALC10.alcOpenDevice(deviceArguments); - if (device == null) + if (device == null) { throw new LWJGLException("Could not open ALC device"); + } if (contextFrequency == -1) { context = ALC10.alcCreateContext(device, null); @@ -177,7 +178,18 @@ public final class AL { throw e; } - ALC11.initialize(); + ALC11.initialize(); + + // Load EFX10 native stubs if ALC_EXT_EFX is supported. + // Is there any situation where the current device supports ALC_EXT_EFX and one + // later created by the user does not? + // Do we have to call resetNativeStubs(EFX10.class); somewhere? Not done for AL11 + // either. + // This can either be here or in ALC11, since ALC_EXT_EFX indirectly requires AL 1.1 + // for functions like alSource3i. + if (ALC10.alcIsExtensionPresent(device, EFX10.ALC_EXT_EFX_NAME)){ + EFX10.initNativeStubs(); + } } /** diff --git a/src/java/org/lwjgl/openal/EFXUtil.java b/src/java/org/lwjgl/openal/EFXUtil.java new file mode 100644 index 00000000..8deea61f --- /dev/null +++ b/src/java/org/lwjgl/openal/EFXUtil.java @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2002-2010 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.openal; + +/** + * Utility class for the OpenAL extension ALC_EXT_EFX. Provides functions to check for the extension + * and support of various effects and filters. + *

+ * Currently supports ALC_EXT_EFX version 1.0 effects and filters. + * + * @author Ciardhubh + * @version $Revision$ + * $Id$ + */ +public final class EFXUtil { + + /** Constant for testSupportGeneric to check an effect. */ + private static final int EFFECT = 1111; + /** Constant for testSupportGeneric to check a filter. */ + private static final int FILTER = 2222; + + /** Utility class, hidden contructor. */ + private EFXUtil() { + } + + /** + * Checks if OpenAL implementation is loaded and supports ALC_EXT_EFX. + * + * @return True if ALC_EXT_EFX is supported, false if not. + * @throws OpenALException If OpenAL has not been created yet. + */ + private static boolean isEfxSupported() { + if (!AL.isCreated()) { + throw new OpenALException("OpenAL has not been created."); + } + if (ALC10.alcIsExtensionPresent(AL.getDevice(), EFX10.ALC_EXT_EFX_NAME)) { + return true; + } + return false; + } + + /** + * Tests OpenAL to see whether the given effect type is supported. This is done by creating an + * effect of the given type. If creation succeeds the effect is supported. + * + * @param effectType Type of effect whose support is to be tested, e.g. AL_EFFECT_REVERB. + * @return True if it is supported, false if not. + * @throws OpenALException If the request fails due to an AL_OUT_OF_MEMORY error or OpenAL has + * not been created yet. + * @throws IllegalArgumentException effectType is not a valid effect type. + */ + public static boolean isEffectSupported(final int effectType) { + // Make sure type is a real effect. + switch (effectType) { + case EFX10.AL_EFFECT_NULL: + case EFX10.AL_EFFECT_EAXREVERB: + case EFX10.AL_EFFECT_REVERB: + case EFX10.AL_EFFECT_CHORUS: + case EFX10.AL_EFFECT_DISTORTION: + case EFX10.AL_EFFECT_ECHO: + case EFX10.AL_EFFECT_FLANGER: + case EFX10.AL_EFFECT_FREQUENCY_SHIFTER: + case EFX10.AL_EFFECT_VOCAL_MORPHER: + case EFX10.AL_EFFECT_PITCH_SHIFTER: + case EFX10.AL_EFFECT_RING_MODULATOR: + case EFX10.AL_EFFECT_AUTOWAH: + case EFX10.AL_EFFECT_COMPRESSOR: + case EFX10.AL_EFFECT_EQUALIZER: + break; + default: + throw new IllegalArgumentException("Unknown or invalid effect type: " + effectType); + } + + return testSupportGeneric(EFFECT, effectType); + } + + /** + * Tests OpenAL to see whether the given filter type is supported. This is done by creating a + * filter of the given type. If creation succeeds the filter is supported. + * + * @param filterType Type of filter whose support is to be tested, e.g. AL_FILTER_LOWPASS. + * @return True if it is supported, false if not. + * @throws OpenALException If the request fails due to an AL_OUT_OF_MEMORY error or OpenAL has + * not been created yet. + * @throws IllegalArgumentException filterType is not a valid filter type. + */ + public static boolean isFilterSupported(final int filterType) { + // Make sure type is a real filter. + switch (filterType) { + case EFX10.AL_FILTER_NULL: + case EFX10.AL_FILTER_LOWPASS: + case EFX10.AL_FILTER_HIGHPASS: + case EFX10.AL_FILTER_BANDPASS: + break; + default: + throw new IllegalArgumentException("Unknown or invalid filter type: " + filterType); + } + + return testSupportGeneric(FILTER, filterType); + } + + /** + * Generic test function to see if an EFX object supports a given kind of type. Works for + * effects and filters. + * + * @param objectType Type of object to test. Must be either EFXUtil.EFFECT or EFXUtil.FILTER. + * @param typeValue OpenAL type the object should be tested for support, e.g. AL_FILTER_LOWPASS + * or AL_EFFECT_REVERB. + * @return True if object supports typeValue, false else. + */ + private static boolean testSupportGeneric(final int objectType, final int typeValue) { + // Check for supported objectType. + switch (objectType) { + case EFFECT: + case FILTER: + break; + default: + throw new IllegalArgumentException("Invalid objectType: " + objectType); + } + + boolean supported = false; + if (isEfxSupported()) { + + // Try to create object in order to check AL's response. + AL10.alGetError(); + int genError; + int testObject = 0; + try { + switch (objectType) { // Create object based on type + case EFFECT: + testObject = EFX10.alGenEffects(); + break; + case FILTER: + testObject = EFX10.alGenFilters(); + break; + default: + throw new IllegalArgumentException("Invalid objectType: " + objectType); + } + genError = AL10.alGetError(); + } catch (final OpenALException debugBuildException) { + // Hack because OpenALException hides the original error code (short of parsing the + // error message String which would break if it gets changed). + if (debugBuildException.getMessage().contains("AL_OUT_OF_MEMORY")) { + genError = AL10.AL_OUT_OF_MEMORY; + } else { + genError = AL10.AL_INVALID_OPERATION; + } + } + + if (genError == AL10.AL_NO_ERROR) { + // Successfully created, now try to set type. + AL10.alGetError(); + int setError; + try { + switch (objectType) { // Set based on object type + case EFFECT: + EFX10.alEffecti(testObject, EFX10.AL_EFFECT_TYPE, typeValue); + break; + case FILTER: + EFX10.alFilteri(testObject, EFX10.AL_FILTER_TYPE, typeValue); + break; + default: + throw new IllegalArgumentException("Invalid objectType: " + objectType); + } + setError = AL10.alGetError(); + } catch (final OpenALException debugBuildException) { + // Hack because OpenALException hides the original error code (short of parsing + // the error message String which would break when it gets changed). + setError = AL10.AL_INVALID_VALUE; + } + + if (setError == AL10.AL_NO_ERROR) { + supported = true; + } + + // Cleanup + try { + switch (objectType) { // Set based on object type + case EFFECT: + EFX10.alDeleteEffects(testObject); + break; + case FILTER: + EFX10.alDeleteFilters(testObject); + break; + default: + throw new IllegalArgumentException("Invalid objectType: " + objectType); + } + } catch (final OpenALException debugBuildException) { + // Don't care about cleanup errors. + } + + } else if (genError == AL10.AL_OUT_OF_MEMORY) { + throw new OpenALException(genError); + } + } + + return supported; + } +} diff --git a/src/java/org/lwjgl/test/openal/EFX10Test.java b/src/java/org/lwjgl/test/openal/EFX10Test.java new file mode 100644 index 00000000..339cd2de --- /dev/null +++ b/src/java/org/lwjgl/test/openal/EFX10Test.java @@ -0,0 +1,464 @@ +/* + * Copyright (c) 2002-2010 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.test.openal; + +import java.nio.IntBuffer; + +import org.lwjgl.BufferUtils; +import org.lwjgl.openal.AL; +import org.lwjgl.openal.AL10; +import org.lwjgl.openal.AL11; +import org.lwjgl.openal.ALC10; +import org.lwjgl.openal.ALCcontext; +import org.lwjgl.openal.ALCdevice; +import org.lwjgl.openal.EFX10; +import org.lwjgl.openal.EFXUtil; +import org.lwjgl.util.WaveData; + +/** + * Class with a few examples testing and demonstrating the use of the OpenAL extension ALC_EXT_EFX. + *

+ * This class is not compatible with the LWJGL debug build (lwjgl-debug.jar), as the debug build + * throws exceptions instead of alGetError checks. The redundant exception handling code was not + * added in order to keep these examples simple. + * + * @author Ciardhubh + * @version $Revision$ + * $Id$ + */ +public final class EFX10Test { + + public static void main(final String[] args) throws Exception { + silentTests(); + playbackTest(); + efxUtilTest(); + } + + /** + * Loads OpenAL and makes sure ALC_EXT_EFX is supported. + */ + private static void setupEfx() throws Exception { + // Load and create OpenAL + if (!AL.isCreated()) { + AL.create(); + } + // Query for Effect Extension + if (!ALC10.alcIsExtensionPresent(AL.getDevice(), EFX10.ALC_EXT_EFX_NAME)) { + throw new Exception("No ALC_EXT_EFX supported by driver."); + } + System.out.println("ALC_EXT_EFX found."); + } + + /** + * Runs a series of API calls similar to the tutorials in the Effects Extension Guide of the + * OpenAL SDK. Nothing is played in this method. + */ + private static void silentTests() throws Exception { + setupEfx(); + + final ALCdevice device = AL.getDevice(); + + // Create context (only necessary if LWJGL context isn't sufficient, done as example) + final IntBuffer contextAttribList = BufferUtils.createIntBuffer(8); + contextAttribList.put(ALC10.ALC_FREQUENCY); + contextAttribList.put(44100); + contextAttribList.put(ALC10.ALC_REFRESH); + contextAttribList.put(60); + contextAttribList.put(ALC10.ALC_SYNC); + contextAttribList.put(ALC10.ALC_FALSE); + contextAttribList.rewind(); + // ALC_MAX_AUXILIARY_SENDS won't go above compile-time max. Set to compile-time max if + // greater. + contextAttribList.put(EFX10.ALC_MAX_AUXILIARY_SENDS); + contextAttribList.put(2); + final ALCcontext newContext = ALC10.alcCreateContext(device, contextAttribList); + if (newContext == null) { + throw new Exception("Failed to create context."); + } + final int contextCurResult = ALC10.alcMakeContextCurrent(newContext); + if (contextCurResult == ALC10.ALC_FALSE) { + throw new Exception("Failed to make context current."); + } + + // Query EFX ALC values + System.out.println("AL_VERSION: " + AL10.alGetString(AL10.AL_VERSION)); + final IntBuffer buff = BufferUtils.createIntBuffer(1); + ALC10.alcGetInteger(device, EFX10.ALC_EFX_MAJOR_VERSION, buff); + System.out.println("ALC_EFX_MAJOR_VERSION: " + buff.get(0)); + ALC10.alcGetInteger(device, EFX10.ALC_EFX_MINOR_VERSION, buff); + System.out.println("ALC_EFX_MINOR_VERSION: " + buff.get(0)); + ALC10.alcGetInteger(device, EFX10.ALC_MAX_AUXILIARY_SENDS, buff); + final int maxAuxSends = buff.get(0); + System.out.println("ALC_MAX_AUXILIARY_SENDS: " + maxAuxSends); + + + // Try to create 4 Auxiliary Effect Slots + int numAuxSlots = 0; + final int[] auxEffectSlots = new int[4]; // try more to test + AL10.alGetError(); + for (numAuxSlots = 0; numAuxSlots < 4; numAuxSlots++) { + auxEffectSlots[numAuxSlots] = EFX10.alGenAuxiliaryEffectSlots(); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + break; + } + } + System.out.println("Created " + numAuxSlots + " aux effect slots."); + + // Try to create 2 Effects + int numEffects = 0; + final int[] effects = new int[2]; + for (numEffects = 0; numEffects < 2; numEffects++) { + effects[numEffects] = EFX10.alGenEffects(); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + break; + } + } + System.out.println("Created " + numEffects + " effects."); + + // Set first Effect Type to Reverb and change Decay Time + AL10.alGetError(); + if (EFX10.alIsEffect(effects[0])) { + EFX10.alEffecti(effects[0], EFX10.AL_EFFECT_TYPE, EFX10.AL_EFFECT_REVERB); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + System.out.println("Reverb effect not supported."); + } else { + EFX10.alEffectf(effects[0], EFX10.AL_REVERB_DECAY_TIME, 5.0f); + System.out.println("Reverb effect created."); + } + } else { + throw new Exception("First effect not a valid effect."); + } + + // Set second Effect Type to Flanger and change Phase + AL10.alGetError(); + if (EFX10.alIsEffect(effects[1])) { + EFX10.alEffecti(effects[1], EFX10.AL_EFFECT_TYPE, EFX10.AL_EFFECT_FLANGER); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + System.out.println("Flanger effect not support."); + } else { + EFX10.alEffecti(effects[1], EFX10.AL_FLANGER_PHASE, 180); + System.out.println("Flanger effect created."); + } + } else { + throw new Exception("Second effect not a valid effect."); + } + + // Try to create a Filter + AL10.alGetError(); + final int filter = EFX10.alGenFilters(); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + throw new Exception("Failed to create filter."); + } + System.out.println("Generated a filter."); + if (EFX10.alIsFilter(filter)) { + // Set Filter type to Low-Pass and set parameters + EFX10.alFilteri(filter, EFX10.AL_FILTER_TYPE, EFX10.AL_FILTER_LOWPASS); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + System.out.println("Low pass filter not supported."); + } else { + EFX10.alFilterf(filter, EFX10.AL_LOWPASS_GAIN, 0.5f); + EFX10.alFilterf(filter, EFX10.AL_LOWPASS_GAINHF, 0.5f); + System.out.println("Low pass filter created."); + } + } + + // Attach Effect to Auxiliary Effect Slot + AL10.alGetError(); + EFX10.alAuxiliaryEffectSloti(auxEffectSlots[0], EFX10.AL_EFFECTSLOT_EFFECT, effects[0]); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + throw new Exception("Failed to attach effect to aux effect slot."); + } + System.out.println("Successfully loaded effect into effect slot."); + + // Configure Source Auxiliary Effect Slot Sends + final int source = AL10.alGenSources(); + // Set Source Send 0 to feed auxEffectSlots[0] without filtering + AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, auxEffectSlots[0], 0, + EFX10.AL_FILTER_NULL); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + throw new Exception("Failed to configure Source Send 0"); + } + System.out.println("Linked aux effect slot to soutce slot 0"); + // Set Source Send 1 to feed uiEffectSlot[1] with filter filter + AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, auxEffectSlots[1], 1, filter); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + // e.g. if only 1 send per source is available + throw new Exception("Failed to configure Source Send 1"); + } + System.out.println("Linked aux effect slot to soutce slot 1"); + // Disable Send 0 + AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, EFX10.AL_EFFECTSLOT_NULL, 0, + EFX10.AL_FILTER_NULL); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + throw new Exception("Failed to disable Source Send 0"); + } + System.out.println("Disabled source send 0"); + // Disable Send 1 + AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, EFX10.AL_EFFECTSLOT_NULL, 1, + EFX10.AL_FILTER_NULL); + if (AL10.alGetError() != AL10.AL_NO_ERROR) { + throw new Exception("Failed to disable Source Send 1"); + } + System.out.println("Disabled source send 1"); + + + // Filter 'source', a generated Source + AL10.alSourcei(source, EFX10.AL_DIRECT_FILTER, filter); + if (AL10.alGetError() == AL10.AL_NO_ERROR) { + { + System.out.println("Successfully applied a direct path filter"); + // Remove filter from 'source' + AL10.alSourcei(source, EFX10.AL_DIRECT_FILTER, EFX10.AL_FILTER_NULL); + if (AL10.alGetError() == AL10.AL_NO_ERROR) { + System.out.println("Successfully removed direct filter"); + } + } + // Filter the Source send 0 from 'source' to Auxiliary Effect Slot auxEffectSlot[0] + // using Filter uiFilter[0] + AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, auxEffectSlots[0], 0, filter); + if (AL10.alGetError() == AL10.AL_NO_ERROR) { + { + System.out.println("Successfully applied aux send filter"); + // Remove Filter from Source Auxiliary Send + AL11.alSource3i(source, EFX10.AL_AUXILIARY_SEND_FILTER, auxEffectSlots[0], 0, + EFX10.AL_FILTER_NULL); + if (AL10.alGetError() == AL10.AL_NO_ERROR) { + System.out.println("Successfully removed filter"); + } + } + } + } + + // Set Source Cone Outer Gain HF value + AL10.alSourcef(source, EFX10.AL_CONE_OUTER_GAINHF, 0.5f); + if (AL10.alGetError() == AL10.AL_NO_ERROR) { + System.out.println("Successfully set cone outside gain filter"); + } + + // Set distance units to be in feet + AL10.alListenerf(EFX10.AL_METERS_PER_UNIT, 0.3f); + if (AL10.alGetError() == AL10.AL_NO_ERROR) { + System.out.println("Successfully set distance units"); + } + + // Cleanup + final IntBuffer auxEffectSlotsBuf = (IntBuffer) BufferUtils.createIntBuffer( + auxEffectSlots.length).put(auxEffectSlots).rewind(); + EFX10.alDeleteAuxiliaryEffectSlots(auxEffectSlotsBuf); + final IntBuffer effectsBuf = (IntBuffer) BufferUtils.createIntBuffer( + effects.length).put(effects).rewind(); + EFX10.alDeleteEffects(effectsBuf); + EFX10.alDeleteFilters(filter); + AL.destroy(); + } + + /** + * 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(WaveData.class.getClassLoader().getResourceAsStream("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(); + } + + /** + * Checks OpenAL for every EFX 1.0 effect and filter and prints the result to the console. + */ + private static void efxUtilTest() throws Exception { + setupEfx(); + + System.out.println(); + System.out.println("Checking supported effects ..."); + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_NULL)) { + System.out.println("AL_EFFECT_NULL is supported."); + } else { + System.out.println("AL_EFFECT_NULL is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_EAXREVERB)) { + System.out.println("AL_EFFECT_EAXREVERB is supported."); + } else { + System.out.println("AL_EFFECT_EAXREVERB is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_REVERB)) { + System.out.println("AL_EFFECT_REVERB is supported."); + } else { + System.out.println("AL_EFFECT_REVERB is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_CHORUS)) { + System.out.println("AL_EFFECT_CHORUS is supported."); + } else { + System.out.println("AL_EFFECT_CHORUS is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_DISTORTION)) { + System.out.println("AL_EFFECT_DISTORTION is supported."); + } else { + System.out.println("AL_EFFECT_DISTORTION is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_ECHO)) { + System.out.println("AL_EFFECT_ECHO is supported."); + } else { + System.out.println("AL_EFFECT_ECHO is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_FLANGER)) { + System.out.println("AL_EFFECT_FLANGER is supported."); + } else { + System.out.println("AL_EFFECT_FLANGER is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_FREQUENCY_SHIFTER)) { + System.out.println("AL_EFFECT_FREQUENCY_SHIFTER is supported."); + } else { + System.out.println("AL_EFFECT_FREQUENCY_SHIFTER is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_VOCAL_MORPHER)) { + System.out.println("AL_EFFECT_VOCAL_MORPHER is supported."); + } else { + System.out.println("AL_EFFECT_VOCAL_MORPHER is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_PITCH_SHIFTER)) { + System.out.println("AL_EFFECT_PITCH_SHIFTER is supported."); + } else { + System.out.println("AL_EFFECT_PITCH_SHIFTER is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_RING_MODULATOR)) { + System.out.println("AL_EFFECT_RING_MODULATOR is supported."); + } else { + System.out.println("AL_EFFECT_RING_MODULATOR is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_AUTOWAH)) { + System.out.println("AL_EFFECT_AUTOWAH is supported."); + } else { + System.out.println("AL_EFFECT_AUTOWAH is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_COMPRESSOR)) { + System.out.println("AL_EFFECT_COMPRESSOR is supported."); + } else { + System.out.println("AL_EFFECT_COMPRESSOR is NOT supported."); + } + if (EFXUtil.isEffectSupported(EFX10.AL_EFFECT_EQUALIZER)) { + System.out.println("AL_EFFECT_EQUALIZER is supported."); + } else { + System.out.println("AL_EFFECT_EQUALIZER is NOT supported."); + } + + System.out.println(); + System.out.println("Checking supported filters ..."); + if (EFXUtil.isFilterSupported(EFX10.AL_FILTER_NULL)) { + System.out.println("AL_FILTER_NULL is supported."); + } else { + System.out.println("AL_FILTER_NULL is NOT supported."); + } + if (EFXUtil.isFilterSupported(EFX10.AL_FILTER_LOWPASS)) { + System.out.println("AL_FILTER_LOWPASS is supported."); + } else { + System.out.println("AL_FILTER_LOWPASS is NOT supported."); + } + if (EFXUtil.isFilterSupported(EFX10.AL_FILTER_HIGHPASS)) { + System.out.println("AL_FILTER_HIGHPASS is supported."); + } else { + System.out.println("AL_FILTER_HIGHPASS is NOT supported."); + } + if (EFXUtil.isFilterSupported(EFX10.AL_FILTER_BANDPASS)) { + System.out.println("AL_FILTER_BANDPASS is supported."); + } else { + System.out.println("AL_FILTER_BANDPASS is NOT supported."); + } + } +} diff --git a/src/java/org/lwjgl/util/generator/FieldsGenerator.java b/src/java/org/lwjgl/util/generator/FieldsGenerator.java index 689390be..7ca5e8c9 100644 --- a/src/java/org/lwjgl/util/generator/FieldsGenerator.java +++ b/src/java/org/lwjgl/util/generator/FieldsGenerator.java @@ -40,34 +40,57 @@ import java.util.*; public class FieldsGenerator { private static void validateField(FieldDeclaration field) { - Collection modifiers = field.getModifiers(); - if (modifiers.size() != 3 || !modifiers.contains(Modifier.PUBLIC) || !modifiers.contains(Modifier.STATIC) || - !modifiers.contains(Modifier.FINAL)) - throw new RuntimeException("Field " + field.getSimpleName() + " is not declared public static final"); - TypeMirror field_type = field.getType(); - if (!(field_type instanceof PrimitiveType)) - throw new RuntimeException("Field " + field.getSimpleName() + " is not a primitive type"); - PrimitiveType field_type_prim = (PrimitiveType)field_type; - if (field_type_prim.getKind() != PrimitiveType.Kind.INT && field_type_prim.getKind() != PrimitiveType.Kind.LONG) - throw new RuntimeException("Field " + field.getSimpleName() + " is not of type 'int' or 'long'"); - Object field_value = field.getConstantValue(); - if (field_value == null) - throw new RuntimeException("Field " + field.getSimpleName() + " has no initial value"); + // Check if field is "public static final" + Collection modifiers = field.getModifiers(); + if (modifiers.size() != 3 + || !modifiers.contains(Modifier.PUBLIC) + || !modifiers.contains(Modifier.STATIC) + || !modifiers.contains(Modifier.FINAL)) { + throw new RuntimeException("Field " + field.getSimpleName() + " is not declared public static final"); + } + + // Check suported types (int, long, float, String) + TypeMirror field_type = field.getType(); + if (field_type instanceof PrimitiveType) { + PrimitiveType field_type_prim = (PrimitiveType) field_type; + PrimitiveType.Kind field_kind = field_type_prim.getKind(); + if (field_kind != PrimitiveType.Kind.INT + && field_kind != PrimitiveType.Kind.LONG + && field_kind != PrimitiveType.Kind.FLOAT) { + throw new RuntimeException("Field " + field.getSimpleName() + " is not of type 'int', 'long' or 'float'"); + } + } else if (field_type.toString().equals("java.lang.String")) { + } else { + throw new RuntimeException("Field " + field.getSimpleName() + " is not a primitive type or String"); + } + + Object field_value = field.getConstantValue(); + if (field_value == null) { + throw new RuntimeException("Field " + field.getSimpleName() + " has no initial value"); + } } private static void generateField(PrintWriter writer, FieldDeclaration field) { - validateField(field); + validateField(field); - Object value = field.getConstantValue(); - String field_value_string; - if ( value.getClass().equals(Integer.class) ) - field_value_string = Integer.toHexString((Integer)field.getConstantValue()); - else - field_value_string = Long.toHexString((Long)field.getConstantValue()) + 'l'; + Object value = field.getConstantValue(); + String field_value_string; + Class field_value_class = value.getClass(); + if (field_value_class.equals(Integer.class)) { + field_value_string = "0x" + Integer.toHexString((Integer) field.getConstantValue()); + } else if (field_value_class.equals(Long.class)) { + field_value_string = "0x" + Long.toHexString((Long) field.getConstantValue()) + 'l'; + } else if (field_value_class.equals(Float.class)) { + field_value_string = field.getConstantValue() + "f"; + } else if (field_value_class.equals(String.class)) { + field_value_string = "\"" + field.getConstantValue() + "\""; + } else { + throw new RuntimeException("Field is of unexpected type. This means there is a bug in validateField()."); + } - Utils.printDocComment(writer, field); - // Print field declaration - writer.println("\tpublic static final " + field.getType().toString() + " " + field.getSimpleName() + " = 0x" + field_value_string + ";"); + Utils.printDocComment(writer, field); + // Print field declaration + writer.println("\tpublic static final " + field.getType().toString() + " " + field.getSimpleName() + " = " + field_value_string + ";"); } public static void generateFields(PrintWriter writer, Collection fields) { diff --git a/src/templates/org/lwjgl/openal/EFX10.java b/src/templates/org/lwjgl/openal/EFX10.java new file mode 100644 index 00000000..cb767002 --- /dev/null +++ b/src/templates/org/lwjgl/openal/EFX10.java @@ -0,0 +1,738 @@ +/* + * Copyright (c) 2002-2010 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.openal; + +import java.nio.FloatBuffer; +import java.nio.IntBuffer; + +import org.lwjgl.util.generator.ALenum; +import org.lwjgl.util.generator.ALsizei; +import org.lwjgl.util.generator.ALuint; +import org.lwjgl.util.generator.ALvoid; +import org.lwjgl.util.generator.Alternate; +import org.lwjgl.util.generator.AutoSize; +import org.lwjgl.util.generator.Check; +import org.lwjgl.util.generator.Const; +import org.lwjgl.util.generator.Constant; +import org.lwjgl.util.generator.Indirect; +import org.lwjgl.util.generator.OutParameter; +import org.lwjgl.util.generator.Result; +import org.lwjgl.util.generator.StripPostfix; + +/** + * Implementation of the OpenAL extension ALC_EXT_EFX (version 1.0). Contains necessary fields, + * methods and a range of supplementary fields containing minimum, maximum and default values of + * the former fields. + *

+ * On top of regular functions defined in the ALC_EXT_EFX, there are also several convenience + * functions. Namely alGen... and alDelete... which do not take a Java buffer parameter and + * automatically create or delete a single object, without the overhead of using a buffer. + *

+ * For comments and specification of functions and fields, refer to the "Effects Extension Guide" + * which is part of the OpenAL SDK and can be downloaded from: + * http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx + * + * @author Ciardhubh + * @version $Revision$ + * $Id$ + */ +public interface EFX10 { + + // ALC properties + String ALC_EXT_EFX_NAME = "ALC_EXT_EFX"; + int ALC_EFX_MAJOR_VERSION = 0x20001; + int ALC_EFX_MINOR_VERSION = 0x20002; + int ALC_MAX_AUXILIARY_SENDS = 0x20003; + + // Listener properties + int AL_METERS_PER_UNIT = 0x20004; + + // Source properties + int AL_DIRECT_FILTER = 0x20005; + int AL_AUXILIARY_SEND_FILTER = 0x20006; + int AL_AIR_ABSORPTION_FACTOR = 0x20007; + int AL_ROOM_ROLLOFF_FACTOR = 0x20008; + int AL_CONE_OUTER_GAINHF = 0x20009; + int AL_DIRECT_FILTER_GAINHF_AUTO = 0x2000A; + int AL_AUXILIARY_SEND_FILTER_GAIN_AUTO = 0x2000B; + int AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO = 0x2000C; + + // Auxiliary effect slot properties + int AL_EFFECTSLOT_EFFECT = 0x0001; + int AL_EFFECTSLOT_GAIN = 0x0002; + int AL_EFFECTSLOT_AUXILIARY_SEND_AUTO = 0x0003; + // NULL auxiliary slot ID to disable a source send + int AL_EFFECTSLOT_NULL = 0x0000; + + // Effect parameters + // Reverb + int AL_REVERB_DENSITY = 0x0001; + int AL_REVERB_DIFFUSION = 0x0002; + int AL_REVERB_GAIN = 0x0003; + int AL_REVERB_GAINHF = 0x0004; + int AL_REVERB_DECAY_TIME = 0x0005; + int AL_REVERB_DECAY_HFRATIO = 0x0006; + int AL_REVERB_REFLECTIONS_GAIN = 0x0007; + int AL_REVERB_REFLECTIONS_DELAY = 0x0008; + int AL_REVERB_LATE_REVERB_GAIN = 0x0009; + int AL_REVERB_LATE_REVERB_DELAY = 0x000A; + int AL_REVERB_AIR_ABSORPTION_GAINHF = 0x000B; + int AL_REVERB_ROOM_ROLLOFF_FACTOR = 0x000C; + int AL_REVERB_DECAY_HFLIMIT = 0x000D; + // EAX Reverb + int AL_EAXREVERB_DENSITY = 0x0001; + int AL_EAXREVERB_DIFFUSION = 0x0002; + int AL_EAXREVERB_GAIN = 0x0003; + int AL_EAXREVERB_GAINHF = 0x0004; + int AL_EAXREVERB_GAINLF = 0x0005; + int AL_EAXREVERB_DECAY_TIME = 0x0006; + int AL_EAXREVERB_DECAY_HFRATIO = 0x0007; + int AL_EAXREVERB_DECAY_LFRATIO = 0x0008; + int AL_EAXREVERB_REFLECTIONS_GAIN = 0x0009; + int AL_EAXREVERB_REFLECTIONS_DELAY = 0x000A; + int AL_EAXREVERB_REFLECTIONS_PAN = 0x000B; + int AL_EAXREVERB_LATE_REVERB_GAIN = 0x000C; + int AL_EAXREVERB_LATE_REVERB_DELAY = 0x000D; + int AL_EAXREVERB_LATE_REVERB_PAN = 0x000E; + int AL_EAXREVERB_ECHO_TIME = 0x000F; + int AL_EAXREVERB_ECHO_DEPTH = 0x0010; + int AL_EAXREVERB_MODULATION_TIME = 0x0011; + int AL_EAXREVERB_MODULATION_DEPTH = 0x0012; + int AL_EAXREVERB_AIR_ABSORPTION_GAINHF = 0x0013; + int AL_EAXREVERB_HFREFERENCE = 0x0014; + int AL_EAXREVERB_LFREFERENCE = 0x0015; + int AL_EAXREVERB_ROOM_ROLLOFF_FACTOR = 0x0016; + int AL_EAXREVERB_DECAY_HFLIMIT = 0x0017; + // Chorus + int AL_CHORUS_WAVEFORM = 0x0001; + int AL_CHORUS_PHASE = 0x0002; + int AL_CHORUS_RATE = 0x0003; + int AL_CHORUS_DEPTH = 0x0004; + int AL_CHORUS_FEEDBACK = 0x0005; + int AL_CHORUS_DELAY = 0x0006; + // Distortion + int AL_DISTORTION_EDGE = 0x0001; + int AL_DISTORTION_GAIN = 0x0002; + int AL_DISTORTION_LOWPASS_CUTOFF = 0x0003; + int AL_DISTORTION_EQCENTER = 0x0004; + int AL_DISTORTION_EQBANDWIDTH = 0x0005; + // Echo + int AL_ECHO_DELAY = 0x0001; + int AL_ECHO_LRDELAY = 0x0002; + int AL_ECHO_DAMPING = 0x0003; + int AL_ECHO_FEEDBACK = 0x0004; + int AL_ECHO_SPREAD = 0x0005; + // Flanger + int AL_FLANGER_WAVEFORM = 0x0001; + int AL_FLANGER_PHASE = 0x0002; + int AL_FLANGER_RATE = 0x0003; + int AL_FLANGER_DEPTH = 0x0004; + int AL_FLANGER_FEEDBACK = 0x0005; + int AL_FLANGER_DELAY = 0x0006; + // Frequency shifter + int AL_FREQUENCY_SHIFTER_FREQUENCY = 0x0001; + int AL_FREQUENCY_SHIFTER_LEFT_DIRECTION = 0x0002; + int AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION = 0x0003; + // Vocal morpher + int AL_VOCAL_MORPHER_PHONEMEA = 0x0001; + int AL_VOCAL_MORPHER_PHONEMEA_COARSE_TUNING = 0x0002; + int AL_VOCAL_MORPHER_PHONEMEB = 0x0003; + int AL_VOCAL_MORPHER_PHONEMEB_COARSE_TUNING = 0x0004; + int AL_VOCAL_MORPHER_WAVEFORM = 0x0005; + int AL_VOCAL_MORPHER_RATE = 0x0006; + // Pitch shifter + int AL_PITCH_SHIFTER_COARSE_TUNE = 0x0001; + int AL_PITCH_SHIFTER_FINE_TUNE = 0x0002; + // Ring modulator + int AL_RING_MODULATOR_FREQUENCY = 0x0001; + int AL_RING_MODULATOR_HIGHPASS_CUTOFF = 0x0002; + int AL_RING_MODULATOR_WAVEFORM = 0x0003; + // Autowah + int AL_AUTOWAH_ATTACK_TIME = 0x0001; + int AL_AUTOWAH_RELEASE_TIME = 0x0002; + int AL_AUTOWAH_RESONANCE = 0x0003; + int AL_AUTOWAH_PEAK_GAIN = 0x0004; + // Compressor + int AL_COMPRESSOR_ONOFF = 0x0001; + // Equalizer + int AL_EQUALIZER_LOW_GAIN = 0x0001; + int AL_EQUALIZER_LOW_CUTOFF = 0x0002; + int AL_EQUALIZER_MID1_GAIN = 0x0003; + int AL_EQUALIZER_MID1_CENTER = 0x0004; + int AL_EQUALIZER_MID1_WIDTH = 0x0005; + int AL_EQUALIZER_MID2_GAIN = 0x0006; + int AL_EQUALIZER_MID2_CENTER = 0x0007; + int AL_EQUALIZER_MID2_WIDTH = 0x0008; + int AL_EQUALIZER_HIGH_GAIN = 0x0009; + int AL_EQUALIZER_HIGH_CUTOFF = 0x000A; + // Effect type + int AL_EFFECT_FIRST_PARAMETER = 0x0000; + int AL_EFFECT_LAST_PARAMETER = 0x8000; + int AL_EFFECT_TYPE = 0x8001; + // Effect types, used with AL_EFFECT_TYPE + int AL_EFFECT_NULL = 0x0000; + int AL_EFFECT_REVERB = 0x0001; + int AL_EFFECT_CHORUS = 0x0002; + int AL_EFFECT_DISTORTION = 0x0003; + int AL_EFFECT_ECHO = 0x0004; + int AL_EFFECT_FLANGER = 0x0005; + int AL_EFFECT_FREQUENCY_SHIFTER = 0x0006; + int AL_EFFECT_VOCAL_MORPHER = 0x0007; + int AL_EFFECT_PITCH_SHIFTER = 0x0008; + int AL_EFFECT_RING_MODULATOR = 0x0009; + int AL_EFFECT_AUTOWAH = 0x000A; + int AL_EFFECT_COMPRESSOR = 0x000B; + int AL_EFFECT_EQUALIZER = 0x000C; + int AL_EFFECT_EAXREVERB = 0x8000; + + // Filter properties + // Lowpass + int AL_LOWPASS_GAIN = 0x0001; + int AL_LOWPASS_GAINHF = 0x0002; + // Highpass + int AL_HIGHPASS_GAIN = 0x0001; + int AL_HIGHPASS_GAINLF = 0x0002; + // Bandpass + int AL_BANDPASS_GAIN = 0x0001; + int AL_BANDPASS_GAINLF = 0x0002; + int AL_BANDPASS_GAINHF = 0x0003; + // Filter type + int AL_FILTER_FIRST_PARAMETER = 0x0000; + int AL_FILTER_LAST_PARAMETER = 0x8000; + int AL_FILTER_TYPE = 0x8001; + // Filter types, used with the AL_FILTER_TYPE property + int AL_FILTER_NULL = 0x0000; + int AL_FILTER_LOWPASS = 0x0001; + int AL_FILTER_HIGHPASS = 0x0002; + int AL_FILTER_BANDPASS = 0x0003; + + // Auxiliary effect slot object functions + @ALvoid + void alGenAuxiliaryEffectSlots(@AutoSize("auxiliaryeffectslots") @ALsizei int n, @OutParameter @ALuint IntBuffer auxiliaryeffectslots); + + @Alternate(value = "alGenAuxiliaryEffectSlots", nativeAlt = true) + @ALvoid + void alGenAuxiliaryEffectSlots2(@Constant("1") @ALsizei int n, @Result @ALuint int auxiliaryeffectslot); + + @ALvoid + void alDeleteAuxiliaryEffectSlots(@AutoSize("auxiliaryeffectslots") @ALsizei int n, @OutParameter @ALuint IntBuffer auxiliaryeffectslots); + + @Alternate(value = "alDeleteAuxiliaryEffectSlots", nativeAlt = true) + @ALvoid + void alDeleteAuxiliaryEffectSlots2(@Constant("1") @ALsizei int n, @Indirect @ALuint int auxiliaryeffectslot); + + boolean alIsAuxiliaryEffectSlot(@ALuint int auxiliaryeffectslot); + + @ALvoid + void alAuxiliaryEffectSloti(@ALuint int auxiliaryeffectslot, @ALenum int param, int value); + + @StripPostfix("values") + @ALvoid + void alAuxiliaryEffectSlotiv(@ALuint int auxiliaryeffectslot, @ALenum int param, @Check("1") @Const IntBuffer values); + + @ALvoid + void alAuxiliaryEffectSlotf(@ALuint int auxiliaryeffectslot, @ALenum int param, float value); + + @StripPostfix("values") + @ALvoid + void alAuxiliaryEffectSlotfv(@ALuint int auxiliaryeffectslot, @ALenum int param, @Check("1") @Const FloatBuffer values); + + @ALvoid + void alGetAuxiliaryEffectSloti(@ALuint int auxiliaryeffectslot, @ALenum int param, @Result int value); + + @StripPostfix("intdata") + @ALvoid + void alGetAuxiliaryEffectSlotiv(@ALuint int auxiliaryeffectslot, @ALenum int param, @OutParameter @Check("1") IntBuffer intdata); + + @ALvoid + void alGetAuxiliaryEffectSlotf(@ALuint int auxiliaryeffectslot, @ALenum int param, @Result float value); + + @StripPostfix("floatdata") + @ALvoid + void alGetAuxiliaryEffectSlotfv(@ALuint int auxiliaryeffectslot, @ALenum int param, @OutParameter @Check("1") FloatBuffer floatdata); + + // Effect object functions + @ALvoid + void alGenEffects(@AutoSize("effects") @ALsizei int n, @OutParameter @ALuint IntBuffer effects); + + @Alternate(value = "alGenEffects", nativeAlt = true) + @ALvoid + void alGenEffects2(@Constant("1") @ALsizei int n, @Result @ALuint int effect); + + @ALvoid + void alDeleteEffects(@AutoSize("effects") @ALsizei int n, @OutParameter @ALuint IntBuffer effects); + + @Alternate(value = "alDeleteEffects", nativeAlt = true) + @ALvoid + void alDeleteEffects2(@Constant("1") @ALsizei int n, @Indirect @ALuint int effect); + + boolean alIsEffect(@ALuint int effect); + + @ALvoid + void alEffecti(@ALuint int effect, @ALenum int param, int value); + + @StripPostfix("values") + @ALvoid + void alEffectiv(@ALuint int effect, @ALenum int param, @Check("1") @Const IntBuffer values); + + @ALvoid + void alEffectf(@ALuint int effect, @ALenum int param, float value); + + @StripPostfix("values") + @ALvoid + void alEffectfv(@ALuint int effect, @ALenum int param, @Check("1") @Const FloatBuffer values); + + @ALvoid + void alGetEffecti(@ALuint int effect, @ALenum int param, @Result int value); + + @StripPostfix("intdata") + @ALvoid + void alGetEffectiv(@ALuint int effect, @ALenum int param, @OutParameter @Check("1") IntBuffer intdata); + + @ALvoid + void alGetEffectf(@ALuint int effect, @ALenum int param, @Result float value); + + @StripPostfix("floatdata") + @ALvoid + void alGetEffectfv(@ALuint int effect, @ALenum int param, @OutParameter @Check("1") FloatBuffer floatdata); + + // Filter object functions + @ALvoid + void alGenFilters(@AutoSize("filters") @ALsizei int n, @OutParameter @ALuint IntBuffer filters); + + @Alternate(value = "alGenFilters", nativeAlt = true) + @ALvoid + void alGenFilters2(@Constant("1") @ALsizei int n, @Result @ALuint int filter); + + @ALvoid + void alDeleteFilters(@AutoSize("filters") @ALsizei int n, @OutParameter @ALuint IntBuffer filters); + + @Alternate(value = "alDeleteFilters", nativeAlt = true) + @ALvoid + void alDeleteFilters2(@Constant("1") @ALsizei int n, @Indirect @ALuint int filter); + + boolean alIsFilter(@ALuint int filter); + + @ALvoid + void alFilteri(@ALuint int filter, @ALenum int param, int value); + + @StripPostfix("values") + @ALvoid + void alFilteriv(@ALuint int filter, @ALenum int param, @Check("1") @Const IntBuffer values); + + @ALvoid + void alFilterf(@ALuint int filter, @ALenum int param, float value); + + @StripPostfix("values") + @ALvoid + void alFilterfv(@ALuint int filter, @ALenum int param, @Check("1") @Const FloatBuffer values); + + @ALvoid + void alGetFilteri(@ALuint int filter, @ALenum int param, @Result int value); + + @StripPostfix("intdata") + @ALvoid + void alGetFilteriv(@ALuint int filter, @ALenum int param, @OutParameter @Check("1") IntBuffer intdata); + + @ALvoid + void alGetFilterf(@ALuint int filter, @ALenum int param, @Result float value); + + @StripPostfix("floatdata") + @ALvoid + void alGetFilterfv(@ALuint int filter, @ALenum int param, @OutParameter @Check("1") FloatBuffer floatdata); + + // Source property value ranges and defaults + float AL_MIN_AIR_ABSORPTION_FACTOR = 0.0f; + float AL_MAX_AIR_ABSORPTION_FACTOR = 10.0f; + float AL_DEFAULT_AIR_ABSORPTION_FACTOR = 0.0f; + float AL_MIN_ROOM_ROLLOFF_FACTOR = 0.0f; + float AL_MAX_ROOM_ROLLOFF_FACTOR = 10.0f; + float AL_DEFAULT_ROOM_ROLLOFF_FACTOR = 0.0f; + float AL_MIN_CONE_OUTER_GAINHF = 0.0f; + float AL_MAX_CONE_OUTER_GAINHF = 1.0f; + float AL_DEFAULT_CONE_OUTER_GAINHF = 1.0f; + int AL_MIN_DIRECT_FILTER_GAINHF_AUTO = AL10.AL_FALSE; + int AL_MAX_DIRECT_FILTER_GAINHF_AUTO = AL10.AL_TRUE; + int AL_DEFAULT_DIRECT_FILTER_GAINHF_AUTO = AL10.AL_TRUE; + int AL_MIN_AUXILIARY_SEND_FILTER_GAIN_AUTO = AL10.AL_FALSE; + int AL_MAX_AUXILIARY_SEND_FILTER_GAIN_AUTO = AL10.AL_TRUE; + int AL_DEFAULT_AUXILIARY_SEND_FILTER_GAIN_AUTO = AL10.AL_TRUE; + int AL_MIN_AUXILIARY_SEND_FILTER_GAINHF_AUTO = AL10.AL_FALSE; + int AL_MAX_AUXILIARY_SEND_FILTER_GAINHF_AUTO = AL10.AL_TRUE; + int AL_DEFAULT_AUXILIARY_SEND_FILTER_GAINHF_AUTO = AL10.AL_TRUE; + + // Listener property value ranges and defaults + float AL_MIN_METERS_PER_UNIT = Float.MIN_VALUE; + float AL_MAX_METERS_PER_UNIT = Float.MAX_VALUE; + float AL_DEFAULT_METERS_PER_UNIT = 1.0f; + + // Effect parameter ranges and defaults + // Reverb + float AL_REVERB_MIN_DENSITY = 0.0f; + float AL_REVERB_MAX_DENSITY = 1.0f; + float AL_REVERB_DEFAULT_DENSITY = 1.0f; + float AL_REVERB_MIN_DIFFUSION = 0.0f; + float AL_REVERB_MAX_DIFFUSION = 1.0f; + float AL_REVERB_DEFAULT_DIFFUSION = 1.0f; + float AL_REVERB_MIN_GAIN = 0.0f; + float AL_REVERB_MAX_GAIN = 1.0f; + float AL_REVERB_DEFAULT_GAIN = 0.32f; + float AL_REVERB_MIN_GAINHF = 0.0f; + float AL_REVERB_MAX_GAINHF = 1.0f; + float AL_REVERB_DEFAULT_GAINHF = 0.89f; + float AL_REVERB_MIN_DECAY_TIME = 0.1f; + float AL_REVERB_MAX_DECAY_TIME = 20.0f; + float AL_REVERB_DEFAULT_DECAY_TIME = 1.49f; + float AL_REVERB_MIN_DECAY_HFRATIO = 0.1f; + float AL_REVERB_MAX_DECAY_HFRATIO = 2.0f; + float AL_REVERB_DEFAULT_DECAY_HFRATIO = 0.83f; + float AL_REVERB_MIN_REFLECTIONS_GAIN = 0.0f; + float AL_REVERB_MAX_REFLECTIONS_GAIN = 3.16f; + float AL_REVERB_DEFAULT_REFLECTIONS_GAIN = 0.05f; + float AL_REVERB_MIN_REFLECTIONS_DELAY = 0.0f; + float AL_REVERB_MAX_REFLECTIONS_DELAY = 0.3f; + float AL_REVERB_DEFAULT_REFLECTIONS_DELAY = 0.007f; + float AL_REVERB_MIN_LATE_REVERB_GAIN = 0.0f; + float AL_REVERB_MAX_LATE_REVERB_GAIN = 10.0f; + float AL_REVERB_DEFAULT_LATE_REVERB_GAIN = 1.26f; + float AL_REVERB_MIN_LATE_REVERB_DELAY = 0.0f; + float AL_REVERB_MAX_LATE_REVERB_DELAY = 0.1f; + float AL_REVERB_DEFAULT_LATE_REVERB_DELAY = 0.011f; + float AL_REVERB_MIN_AIR_ABSORPTION_GAINHF = 0.892f; + float AL_REVERB_MAX_AIR_ABSORPTION_GAINHF = 1.0f; + float AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF = 0.994f; + float AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR = 0.0f; + float AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR = 10.0f; + float AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR = 0.0f; + int AL_REVERB_MIN_DECAY_HFLIMIT = AL10.AL_FALSE; + int AL_REVERB_MAX_DECAY_HFLIMIT = AL10.AL_TRUE; + int AL_REVERB_DEFAULT_DECAY_HFLIMIT = AL10.AL_TRUE; + // EAX reverb + float AL_EAXREVERB_MIN_DENSITY = 0.0f; + float AL_EAXREVERB_MAX_DENSITY = 1.0f; + float AL_EAXREVERB_DEFAULT_DENSITY = 1.0f; + float AL_EAXREVERB_MIN_DIFFUSION = 0.0f; + float AL_EAXREVERB_MAX_DIFFUSION = 1.0f; + float AL_EAXREVERB_DEFAULT_DIFFUSION = 1.0f; + float AL_EAXREVERB_MIN_GAIN = 0.0f; + float AL_EAXREVERB_MAX_GAIN = 1.0f; + float AL_EAXREVERB_DEFAULT_GAIN = 0.32f; + float AL_EAXREVERB_MIN_GAINHF = 0.0f; + float AL_EAXREVERB_MAX_GAINHF = 1.0f; + float AL_EAXREVERB_DEFAULT_GAINHF = 0.89f; + float AL_EAXREVERB_MIN_GAINLF = 0.0f; + float AL_EAXREVERB_MAX_GAINLF = 1.0f; + float AL_EAXREVERB_DEFAULT_GAINLF = 1.0f; + float AL_EAXREVERB_MIN_DECAY_TIME = 0.1f; + float AL_EAXREVERB_MAX_DECAY_TIME = 20.0f; + float AL_EAXREVERB_DEFAULT_DECAY_TIME = 1.49f; + float AL_EAXREVERB_MIN_DECAY_HFRATIO = 0.1f; + float AL_EAXREVERB_MAX_DECAY_HFRATIO = 2.0f; + float AL_EAXREVERB_DEFAULT_DECAY_HFRATIO = 0.83f; + float AL_EAXREVERB_MIN_DECAY_LFRATIO = 0.1f; + float AL_EAXREVERB_MAX_DECAY_LFRATIO = 2.0f; + float AL_EAXREVERB_DEFAULT_DECAY_LFRATIO = 1.0f; + float AL_EAXREVERB_MIN_REFLECTIONS_GAIN = 0.0f; + float AL_EAXREVERB_MAX_REFLECTIONS_GAIN = 3.16f; + float AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN = 0.05f; + float AL_EAXREVERB_MIN_REFLECTIONS_DELAY = 0.0f; + float AL_EAXREVERB_MAX_REFLECTIONS_DELAY = 0.3f; + float AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY = 0.007f; + float AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ = 0.0f; + float AL_EAXREVERB_MIN_LATE_REVERB_GAIN = 0.0f; + float AL_EAXREVERB_MAX_LATE_REVERB_GAIN = 10.0f; + float AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN = 1.26f; + float AL_EAXREVERB_MIN_LATE_REVERB_DELAY = 0.0f; + float AL_EAXREVERB_MAX_LATE_REVERB_DELAY = 0.1f; + float AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY = 0.011f; + float AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ = 0.0f; + float AL_EAXREVERB_MIN_ECHO_TIME = 0.075f; + float AL_EAXREVERB_MAX_ECHO_TIME = 0.25f; + float AL_EAXREVERB_DEFAULT_ECHO_TIME = 0.25f; + float AL_EAXREVERB_MIN_ECHO_DEPTH = 0.0f; + float AL_EAXREVERB_MAX_ECHO_DEPTH = 1.0f; + float AL_EAXREVERB_DEFAULT_ECHO_DEPTH = 0.0f; + float AL_EAXREVERB_MIN_MODULATION_TIME = 0.04f; + float AL_EAXREVERB_MAX_MODULATION_TIME = 4.0f; + float AL_EAXREVERB_DEFAULT_MODULATION_TIME = 0.25f; + float AL_EAXREVERB_MIN_MODULATION_DEPTH = 0.0f; + float AL_EAXREVERB_MAX_MODULATION_DEPTH = 1.0f; + float AL_EAXREVERB_DEFAULT_MODULATION_DEPTH = 0.0f; + float AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF = 0.892f; + float AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF = 1.0f; + float AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF = 0.994f; + float AL_EAXREVERB_MIN_HFREFERENCE = 1000.0f; + float AL_EAXREVERB_MAX_HFREFERENCE = 20000.0f; + float AL_EAXREVERB_DEFAULT_HFREFERENCE = 5000.0f; + float AL_EAXREVERB_MIN_LFREFERENCE = 20.0f; + float AL_EAXREVERB_MAX_LFREFERENCE = 1000.0f; + float AL_EAXREVERB_DEFAULT_LFREFERENCE = 250.0f; + float AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR = 0.0f; + float AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR = 10.0f; + float AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR = 0.0f; + int AL_EAXREVERB_MIN_DECAY_HFLIMIT = AL10.AL_FALSE; + int AL_EAXREVERB_MAX_DECAY_HFLIMIT = AL10.AL_TRUE; + int AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT = AL10.AL_TRUE; + // Chorus + int AL_CHORUS_WAVEFORM_SINUSOID = 0; + int AL_CHORUS_WAVEFORM_TRIANGLE = 1; + int AL_CHORUS_MIN_WAVEFORM = 0; + int AL_CHORUS_MAX_WAVEFORM = 1; + int AL_CHORUS_DEFAULT_WAVEFORM = 1; + int AL_CHORUS_MIN_PHASE = -180; + int AL_CHORUS_MAX_PHASE = 180; + int AL_CHORUS_DEFAULT_PHASE = 90; + float AL_CHORUS_MIN_RATE = 0.0f; + float AL_CHORUS_MAX_RATE = 10.0f; + float AL_CHORUS_DEFAULT_RATE = 1.1f; + float AL_CHORUS_MIN_DEPTH = 0.0f; + float AL_CHORUS_MAX_DEPTH = 1.0f; + float AL_CHORUS_DEFAULT_DEPTH = 0.1f; + float AL_CHORUS_MIN_FEEDBACK = -1.0f; + float AL_CHORUS_MAX_FEEDBACK = 1.0f; + float AL_CHORUS_DEFAULT_FEEDBACK = 0.25f; + float AL_CHORUS_MIN_DELAY = 0.0f; + float AL_CHORUS_MAX_DELAY = 0.016f; + float AL_CHORUS_DEFAULT_DELAY = 0.016f; + // Distortion + float AL_DISTORTION_MIN_EDGE = 0.0f; + float AL_DISTORTION_MAX_EDGE = 1.0f; + float AL_DISTORTION_DEFAULT_EDGE = 0.2f; + float AL_DISTORTION_MIN_GAIN = 0.01f; + float AL_DISTORTION_MAX_GAIN = 1.0f; + float AL_DISTORTION_DEFAULT_GAIN = 0.05f; + float AL_DISTORTION_MIN_LOWPASS_CUTOFF = 80.0f; + float AL_DISTORTION_MAX_LOWPASS_CUTOFF = 24000.0f; + float AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF = 8000.0f; + float AL_DISTORTION_MIN_EQCENTER = 80.0f; + float AL_DISTORTION_MAX_EQCENTER = 24000.0f; + float AL_DISTORTION_DEFAULT_EQCENTER = 3600.0f; + float AL_DISTORTION_MIN_EQBANDWIDTH = 80.0f; + float AL_DISTORTION_MAX_EQBANDWIDTH = 24000.0f; + float AL_DISTORTION_DEFAULT_EQBANDWIDTH = 3600.0f; + // Echo + float AL_ECHO_MIN_DELAY = 0.0f; + float AL_ECHO_MAX_DELAY = 0.207f; + float AL_ECHO_DEFAULT_DELAY = 0.1f; + float AL_ECHO_MIN_LRDELAY = 0.0f; + float AL_ECHO_MAX_LRDELAY = 0.404f; + float AL_ECHO_DEFAULT_LRDELAY = 0.1f; + float AL_ECHO_MIN_DAMPING = 0.0f; + float AL_ECHO_MAX_DAMPING = 0.99f; + float AL_ECHO_DEFAULT_DAMPING = 0.5f; + float AL_ECHO_MIN_FEEDBACK = 0.0f; + float AL_ECHO_MAX_FEEDBACK = 1.0f; + float AL_ECHO_DEFAULT_FEEDBACK = 0.5f; + float AL_ECHO_MIN_SPREAD = -1.0f; + float AL_ECHO_MAX_SPREAD = 1.0f; + float AL_ECHO_DEFAULT_SPREAD = -1.0f; + // Flanger + int AL_FLANGER_WAVEFORM_SINUSOID = 0; + int AL_FLANGER_WAVEFORM_TRIANGLE = 1; + int AL_FLANGER_MIN_WAVEFORM = 0; + int AL_FLANGER_MAX_WAVEFORM = 1; + int AL_FLANGER_DEFAULT_WAVEFORM = 1; + int AL_FLANGER_MIN_PHASE = -180; + int AL_FLANGER_MAX_PHASE = 180; + int AL_FLANGER_DEFAULT_PHASE = 0; + float AL_FLANGER_MIN_RATE = 0.0f; + float AL_FLANGER_MAX_RATE = 10.0f; + float AL_FLANGER_DEFAULT_RATE = 0.27f; + float AL_FLANGER_MIN_DEPTH = 0.0f; + float AL_FLANGER_MAX_DEPTH = 1.0f; + float AL_FLANGER_DEFAULT_DEPTH = 1.0f; + float AL_FLANGER_MIN_FEEDBACK = -1.0f; + float AL_FLANGER_MAX_FEEDBACK = 1.0f; + float AL_FLANGER_DEFAULT_FEEDBACK = -0.5f; + float AL_FLANGER_MIN_DELAY = 0.0f; + float AL_FLANGER_MAX_DELAY = 0.004f; + float AL_FLANGER_DEFAULT_DELAY = 0.002f; + // Frequency shifter + float AL_FREQUENCY_SHIFTER_MIN_FREQUENCY = 0.0f; + float AL_FREQUENCY_SHIFTER_MAX_FREQUENCY = 24000.0f; + float AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY = 0.0f; + int AL_FREQUENCY_SHIFTER_MIN_LEFT_DIRECTION = 0; + int AL_FREQUENCY_SHIFTER_MAX_LEFT_DIRECTION = 2; + int AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION = 0; + int AL_FREQUENCY_SHIFTER_DIRECTION_DOWN = 0; + int AL_FREQUENCY_SHIFTER_DIRECTION_UP = 1; + int AL_FREQUENCY_SHIFTER_DIRECTION_OFF = 2; + int AL_FREQUENCY_SHIFTER_MIN_RIGHT_DIRECTION = 0; + int AL_FREQUENCY_SHIFTER_MAX_RIGHT_DIRECTION = 2; + int AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION = 0; + // Vocal morpher + int AL_VOCAL_MORPHER_MIN_PHONEMEA = 0; + int AL_VOCAL_MORPHER_MAX_PHONEMEA = 29; + int AL_VOCAL_MORPHER_DEFAULT_PHONEMEA = 0; + int AL_VOCAL_MORPHER_MIN_PHONEMEA_COARSE_TUNING = -24; + int AL_VOCAL_MORPHER_MAX_PHONEMEA_COARSE_TUNING = 24; + int AL_VOCAL_MORPHER_DEFAULT_PHONEMEA_COARSE_TUNING = 0; + int AL_VOCAL_MORPHER_MIN_PHONEMEB = 0; + int AL_VOCAL_MORPHER_MAX_PHONEMEB = 29; + int AL_VOCAL_MORPHER_DEFAULT_PHONEMEB = 10; + int AL_VOCAL_MORPHER_MIN_PHONEMEB_COARSE_TUNING = -24; + int AL_VOCAL_MORPHER_MAX_PHONEMEB_COARSE_TUNING = 24; + int AL_VOCAL_MORPHER_DEFAULT_PHONEMEB_COARSE_TUNING = 0; + int AL_VOCAL_MORPHER_PHONEME_A = 0; + int AL_VOCAL_MORPHER_PHONEME_E = 1; + int AL_VOCAL_MORPHER_PHONEME_I = 2; + int AL_VOCAL_MORPHER_PHONEME_O = 3; + int AL_VOCAL_MORPHER_PHONEME_U = 4; + int AL_VOCAL_MORPHER_PHONEME_AA = 5; + int AL_VOCAL_MORPHER_PHONEME_AE = 6; + int AL_VOCAL_MORPHER_PHONEME_AH = 7; + int AL_VOCAL_MORPHER_PHONEME_AO = 8; + int AL_VOCAL_MORPHER_PHONEME_EH = 9; + int AL_VOCAL_MORPHER_PHONEME_ER = 10; + int AL_VOCAL_MORPHER_PHONEME_IH = 11; + int AL_VOCAL_MORPHER_PHONEME_IY = 12; + int AL_VOCAL_MORPHER_PHONEME_UH = 13; + int AL_VOCAL_MORPHER_PHONEME_UW = 14; + int AL_VOCAL_MORPHER_PHONEME_B = 15; + int AL_VOCAL_MORPHER_PHONEME_D = 16; + int AL_VOCAL_MORPHER_PHONEME_F = 17; + int AL_VOCAL_MORPHER_PHONEME_G = 18; + int AL_VOCAL_MORPHER_PHONEME_J = 19; + int AL_VOCAL_MORPHER_PHONEME_K = 20; + int AL_VOCAL_MORPHER_PHONEME_L = 21; + int AL_VOCAL_MORPHER_PHONEME_M = 22; + int AL_VOCAL_MORPHER_PHONEME_N = 23; + int AL_VOCAL_MORPHER_PHONEME_P = 24; + int AL_VOCAL_MORPHER_PHONEME_R = 25; + int AL_VOCAL_MORPHER_PHONEME_S = 26; + int AL_VOCAL_MORPHER_PHONEME_T = 27; + int AL_VOCAL_MORPHER_PHONEME_V = 28; + int AL_VOCAL_MORPHER_PHONEME_Z = 29; + int AL_VOCAL_MORPHER_WAVEFORM_SINUSOID = 0; + int AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE = 1; + int AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH = 2; + int AL_VOCAL_MORPHER_MIN_WAVEFORM = 0; + int AL_VOCAL_MORPHER_MAX_WAVEFORM = 2; + int AL_VOCAL_MORPHER_DEFAULT_WAVEFORM = 0; + float AL_VOCAL_MORPHER_MIN_RATE = 0.0f; + float AL_VOCAL_MORPHER_MAX_RATE = 10.0f; + float AL_VOCAL_MORPHER_DEFAULT_RATE = 1.41f; + // Pitch shifter + int AL_PITCH_SHIFTER_MIN_COARSE_TUNE = -12; + int AL_PITCH_SHIFTER_MAX_COARSE_TUNE = 12; + int AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE = 12; + int AL_PITCH_SHIFTER_MIN_FINE_TUNE = -50; + int AL_PITCH_SHIFTER_MAX_FINE_TUNE = 50; + int AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE = 0; + // Ring modulator + float AL_RING_MODULATOR_MIN_FREQUENCY = 0.0f; + float AL_RING_MODULATOR_MAX_FREQUENCY = 8000.0f; + float AL_RING_MODULATOR_DEFAULT_FREQUENCY = 440.0f; + float AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF = 0.0f; + float AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF = 24000.0f; + float AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF = 800.0f; + int AL_RING_MODULATOR_SINUSOID = 0; + int AL_RING_MODULATOR_SAWTOOTH = 1; + int AL_RING_MODULATOR_SQUARE = 2; + int AL_RING_MODULATOR_MIN_WAVEFORM = 0; + int AL_RING_MODULATOR_MAX_WAVEFORM = 2; + int AL_RING_MODULATOR_DEFAULT_WAVEFORM = 0; + // Autowah + float AL_AUTOWAH_MIN_ATTACK_TIME = 0.0001f; + float AL_AUTOWAH_MAX_ATTACK_TIME = 1.0f; + float AL_AUTOWAH_DEFAULT_ATTACK_TIME = 0.06f; + float AL_AUTOWAH_MIN_RELEASE_TIME = 0.0001f; + float AL_AUTOWAH_MAX_RELEASE_TIME = 1.0f; + float AL_AUTOWAH_DEFAULT_RELEASE_TIME = 0.06f; + float AL_AUTOWAH_MIN_RESONANCE = 2.0f; + float AL_AUTOWAH_MAX_RESONANCE = 1000.0f; + float AL_AUTOWAH_DEFAULT_RESONANCE = 1000.0f; + float AL_AUTOWAH_MIN_PEAK_GAIN = 0.00003f; + float AL_AUTOWAH_MAX_PEAK_GAIN = 31621.0f; + float AL_AUTOWAH_DEFAULT_PEAK_GAIN = 11.22f; + // Compressor + int AL_COMPRESSOR_MIN_ONOFF = 0; + int AL_COMPRESSOR_MAX_ONOFF = 1; + int AL_COMPRESSOR_DEFAULT_ONOFF = 1; + // Equalizer + float AL_EQUALIZER_MIN_LOW_GAIN = 0.126f; + float AL_EQUALIZER_MAX_LOW_GAIN = 7.943f; + float AL_EQUALIZER_DEFAULT_LOW_GAIN = 1.0f; + float AL_EQUALIZER_MIN_LOW_CUTOFF = 50.0f; + float AL_EQUALIZER_MAX_LOW_CUTOFF = 800.0f; + float AL_EQUALIZER_DEFAULT_LOW_CUTOFF = 200.0f; + float AL_EQUALIZER_MIN_MID1_GAIN = 0.126f; + float AL_EQUALIZER_MAX_MID1_GAIN = 7.943f; + float AL_EQUALIZER_DEFAULT_MID1_GAIN = 1.0f; + float AL_EQUALIZER_MIN_MID1_CENTER = 200.0f; + float AL_EQUALIZER_MAX_MID1_CENTER = 3000.0f; + float AL_EQUALIZER_DEFAULT_MID1_CENTER = 500.0f; + float AL_EQUALIZER_MIN_MID1_WIDTH = 0.01f; + float AL_EQUALIZER_MAX_MID1_WIDTH = 1.0f; + float AL_EQUALIZER_DEFAULT_MID1_WIDTH = 1.0f; + float AL_EQUALIZER_MIN_MID2_GAIN = 0.126f; + float AL_EQUALIZER_MAX_MID2_GAIN = 7.943f; + float AL_EQUALIZER_DEFAULT_MID2_GAIN = 1.0f; + float AL_EQUALIZER_MIN_MID2_CENTER = 1000.0f; + float AL_EQUALIZER_MAX_MID2_CENTER = 8000.0f; + float AL_EQUALIZER_DEFAULT_MID2_CENTER = 3000.0f; + float AL_EQUALIZER_MIN_MID2_WIDTH = 0.01f; + float AL_EQUALIZER_MAX_MID2_WIDTH = 1.0f; + float AL_EQUALIZER_DEFAULT_MID2_WIDTH = 1.0f; + float AL_EQUALIZER_MIN_HIGH_GAIN = 0.126f; + float AL_EQUALIZER_MAX_HIGH_GAIN = 7.943f; + float AL_EQUALIZER_DEFAULT_HIGH_GAIN = 1.0f; + float AL_EQUALIZER_MIN_HIGH_CUTOFF = 4000.0f; + float AL_EQUALIZER_MAX_HIGH_CUTOFF = 16000.0f; + float AL_EQUALIZER_DEFAULT_HIGH_CUTOFF = 6000.0f; + + // Filter parameter ranges and defaults + // Lowpass + float LOWPASS_MIN_GAIN = 0.0f; + float LOWPASS_MAX_GAIN = 1.0f; + float LOWPASS_DEFAULT_GAIN = 1.0f; + float LOWPASS_MIN_GAINHF = 0.0f; + float LOWPASS_MAX_GAINHF = 1.0f; + float LOWPASS_DEFAULT_GAINHF = 1.0f; + // Highpass + float HIGHPASS_MIN_GAIN = 0.0f; + float HIGHPASS_MAX_GAIN = 1.0f; + float HIGHPASS_DEFAULT_GAIN = 1.0f; + float HIGHPASS_MIN_GAINLF = 0.0f; + float HIGHPASS_MAX_GAINLF = 1.0f; + float HIGHPASS_DEFAULT_GAINLF = 1.0f; + // Bandpass + float BANDPASS_MIN_GAIN = 0.0f; + float BANDPASS_MAX_GAIN = 1.0f; + float BANDPASS_DEFAULT_GAIN = 1.0f; + float BANDPASS_MIN_GAINHF = 0.0f; + float BANDPASS_MAX_GAINHF = 1.0f; + float BANDPASS_DEFAULT_GAINHF = 1.0f; + float BANDPASS_MIN_GAINLF = 0.0f; + float BANDPASS_MAX_GAINLF = 1.0f; + float BANDPASS_DEFAULT_GAINLF = 1.0f; +}