public class AL10
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
AL_BITS
Buffer attributes,
|
static int |
AL_BUFFER
Source attributes.
|
static int |
AL_BUFFERS_PROCESSED
Queue state.
|
static int |
AL_BUFFERS_QUEUED
Queue state.
|
static int |
AL_CHANNELS
Buffer attributes,
|
static int |
AL_CONE_INNER_ANGLE
Source attributes.
|
static int |
AL_CONE_OUTER_ANGLE
Source attributes.
|
static int |
AL_CONE_OUTER_GAIN
Source attributes.
|
static int |
AL_DIRECTION
Source attributes.
|
static int |
AL_DISTANCE_MODEL
Numerical queries.
|
static int |
AL_DOPPLER_FACTOR
Numerical queries.
|
static int |
AL_EXTENSIONS
String queries.
|
static int |
AL_FALSE
General tokens.
|
static int |
AL_FORMAT_MONO16
Buffer formats.
|
static int |
AL_FORMAT_MONO8
Buffer formats.
|
static int |
AL_FORMAT_STEREO16
Buffer formats.
|
static int |
AL_FORMAT_STEREO8
Buffer formats.
|
static int |
AL_FREQUENCY
Buffer attributes,
|
static int |
AL_GAIN
Listener and Source attributes.
|
static int |
AL_INITIAL
Source state.
|
static int |
AL_INVALID
General tokens.
|
static int |
AL_INVALID_ENUM
Error conditions.
|
static int |
AL_INVALID_NAME
Error conditions.
|
static int |
AL_INVALID_OPERATION
Error conditions.
|
static int |
AL_INVALID_VALUE
Error conditions.
|
static int |
AL_INVERSE_DISTANCE
Distance attenuation models.
|
static int |
AL_INVERSE_DISTANCE_CLAMPED
Distance attenuation models.
|
static int |
AL_LOOPING
Source attributes.
|
static int |
AL_MAX_DISTANCE
Distance model attributes,
|
static int |
AL_MAX_GAIN
Gain bounds.
|
static int |
AL_MIN_GAIN
Gain bounds.
|
static int |
AL_NO_ERROR
Error conditions.
|
static int |
AL_NONE
General tokens.
|
static int |
AL_ORIENTATION
Listener attributes.
|
static int |
AL_OUT_OF_MEMORY
Error conditions.
|
static int |
AL_PAUSED
Source state.
|
static int |
AL_PENDING
Buffer state.
|
static int |
AL_PITCH
Source attributes.
|
static int |
AL_PLAYING
Source state.
|
static int |
AL_POSITION
Listener and Source attributes.
|
static int |
AL_PROCESSED
Buffer state.
|
static int |
AL_REFERENCE_DISTANCE
Distance model attributes,
|
static int |
AL_RENDERER
String queries.
|
static int |
AL_ROLLOFF_FACTOR
Distance model attributes,
|
static int |
AL_SIZE
Buffer attributes,
|
static int |
AL_SOURCE_ABSOLUTE
Source types.
|
static int |
AL_SOURCE_RELATIVE
Source types.
|
static int |
AL_SOURCE_STATE
Source attributes.
|
static int |
AL_SOURCE_TYPE
Source attributes.
|
static int |
AL_STOPPED
Source state.
|
static int |
AL_TRUE
General tokens.
|
static int |
AL_UNUSED
Buffer state.
|
static int |
AL_VELOCITY
Listener and Source attributes.
|
static int |
AL_VENDOR
String queries.
|
static int |
AL_VERSION
String queries.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
alBufferData(int bufferName,
int format,
java.nio.ByteBuffer data,
int frequency)
Sets the sample data of the specified buffer.
|
static void |
alBufferData(int bufferName,
int format,
float[] data,
int frequency)
Array version of:
BufferData |
static void |
alBufferData(int bufferName,
int format,
java.nio.FloatBuffer data,
int frequency)
Sets the sample data of the specified buffer.
|
static void |
alBufferData(int bufferName,
int format,
int[] data,
int frequency)
Array version of:
BufferData |
static void |
alBufferData(int bufferName,
int format,
java.nio.IntBuffer data,
int frequency)
Sets the sample data of the specified buffer.
|
static void |
alBufferData(int bufferName,
int format,
short[] data,
int frequency)
Array version of:
BufferData |
static void |
alBufferData(int bufferName,
int format,
java.nio.ShortBuffer data,
int frequency)
Sets the sample data of the specified buffer.
|
static void |
alDeleteBuffers(int bufferName)
Requests the deletion of a number of buffers.
|
static void |
alDeleteBuffers(int[] bufferNames)
Array version of:
DeleteBuffers |
static void |
alDeleteBuffers(java.nio.IntBuffer bufferNames)
Requests the deletion of a number of buffers.
|
static void |
alDeleteSources(int source)
Requests the deletion of a number of sources.
|
static void |
alDeleteSources(int[] sources)
Array version of:
DeleteSources |
static void |
alDeleteSources(java.nio.IntBuffer sources)
Requests the deletion of a number of sources.
|
static void |
alDisable(int target)
Disables AL capabilities.
|
static void |
alDistanceModel(int modelName)
Sets the distance attenuation model.
|
static void |
alDopplerFactor(float dopplerFactor)
Sets the doppler effect factor.
|
static void |
alDopplerVelocity(float dopplerVelocity)
Sets the doppler effect propagation velocity.
|
static void |
alEnable(int target)
Enables AL capabilities.
|
static int |
alGenBuffers()
Requests a number of buffer names.
|
static void |
alGenBuffers(int[] bufferNames)
Array version of:
GenBuffers |
static void |
alGenBuffers(java.nio.IntBuffer bufferNames)
Requests a number of buffer names.
|
static int |
alGenSources()
Requests a number of source names.
|
static void |
alGenSources(int[] srcNames)
Array version of:
GenSources |
static void |
alGenSources(java.nio.IntBuffer srcNames)
Requests a number of source names.
|
static boolean |
alGetBoolean(int paramName)
Returns the boolean value of the specified parameter.
|
static void |
alGetBooleanv(int paramName,
java.nio.ByteBuffer dest)
Pointer version of
GetBoolean. |
static float |
alGetBufferf(int bufferName,
int paramName)
Returns the float value of the specified buffer parameter.
|
static void |
alGetBufferf(int bufferName,
int paramName,
float[] value)
Array version of:
GetBufferf |
static void |
alGetBufferf(int bufferName,
int paramName,
java.nio.FloatBuffer value)
Returns the float value of the specified buffer parameter.
|
static int |
alGetBufferi(int bufferName,
int paramName)
Returns the integer value of the specified buffer parameter.
|
static void |
alGetBufferi(int bufferName,
int paramName,
int[] value)
Array version of:
GetBufferi |
static void |
alGetBufferi(int bufferName,
int paramName,
java.nio.IntBuffer value)
Returns the integer value of the specified buffer parameter.
|
static double |
alGetDouble(int paramName)
Returns the double value of the specified parameter.
|
static void |
alGetDoublev(int paramName,
double[] dest)
Array version of:
GetDoublev |
static void |
alGetDoublev(int paramName,
java.nio.DoubleBuffer dest)
Pointer version of
GetDouble. |
static int |
alGetEnumValue(java.nio.ByteBuffer enumName)
Returns the enumeration value of the specified enum.
|
static int |
alGetEnumValue(java.lang.CharSequence enumName)
Returns the enumeration value of the specified enum.
|
static int |
alGetError()
Obtains error information.
|
static float |
alGetFloat(int paramName)
Returns the float value of the specified parameter.
|
static void |
alGetFloatv(int paramName,
float[] dest)
Array version of:
GetFloatv |
static void |
alGetFloatv(int paramName,
java.nio.FloatBuffer dest)
Pointer version of
GetFloat. |
static int |
alGetInteger(int paramName)
Returns the integer value of the specified parameter.
|
static void |
alGetIntegerv(int paramName,
int[] dest)
Array version of:
GetIntegerv |
static void |
alGetIntegerv(int paramName,
java.nio.IntBuffer dest)
Pointer version of
GetInteger. |
static void |
alGetListener3f(int paramName,
float[] value1,
float[] value2,
float[] value3)
Array version of:
GetListener3f |
static void |
alGetListener3f(int paramName,
java.nio.FloatBuffer value1,
java.nio.FloatBuffer value2,
java.nio.FloatBuffer value3)
Returns the 3 dimensional values of a listener parameter.
|
static float |
alGetListenerf(int paramName)
Returns the float value of a listener parameter.
|
static void |
alGetListenerf(int paramName,
float[] value)
Array version of:
GetListenerf |
static void |
alGetListenerf(int paramName,
java.nio.FloatBuffer value)
Returns the float value of a listener parameter.
|
static void |
alGetListenerfv(int paramName,
float[] values)
Array version of:
GetListenerfv |
static void |
alGetListenerfv(int paramName,
java.nio.FloatBuffer values)
Returns float values of a listener parameter.
|
static int |
alGetListeneri(int paramName)
Returns the integer value of a listener parameter.
|
static void |
alGetListeneri(int paramName,
int[] value)
Array version of:
GetListeneri |
static void |
alGetListeneri(int paramName,
java.nio.IntBuffer value)
Returns the integer value of a listener parameter.
|
static long |
alGetProcAddress(java.nio.ByteBuffer funcName)
Retrieves extension entry points.
|
static long |
alGetProcAddress(java.lang.CharSequence funcName)
Retrieves extension entry points.
|
static void |
alGetSource3f(int source,
int param,
float[] v1,
float[] v2,
float[] v3)
Array version of:
GetSource3f |
static void |
alGetSource3f(int source,
int param,
java.nio.FloatBuffer v1,
java.nio.FloatBuffer v2,
java.nio.FloatBuffer v3)
Returns the 3 dimensional values of the specified source parameter.
|
static float |
alGetSourcef(int source,
int param)
Returns the float value of the specified source parameter.
|
static void |
alGetSourcef(int source,
int param,
float[] value)
Array version of:
GetSourcef |
static void |
alGetSourcef(int source,
int param,
java.nio.FloatBuffer value)
Returns the float value of the specified source parameter.
|
static void |
alGetSourcefv(int source,
int param,
float[] values)
Array version of:
GetSourcefv |
static void |
alGetSourcefv(int source,
int param,
java.nio.FloatBuffer values)
Returns the float values of the specified source parameter.
|
static int |
alGetSourcei(int source,
int param)
Returns the integer value of the specified source parameter.
|
static void |
alGetSourcei(int source,
int param,
int[] value)
Array version of:
GetSourcei |
static void |
alGetSourcei(int source,
int param,
java.nio.IntBuffer value)
Returns the integer value of the specified source parameter.
|
static void |
alGetSourceiv(int source,
int param,
int[] values)
Array version of:
GetSourceiv |
static void |
alGetSourceiv(int source,
int param,
java.nio.IntBuffer values)
Returns the integer values of the specified source parameter.
|
static java.lang.String |
alGetString(int paramName)
Returns the string value of the specified parameter
|
static boolean |
alIsBuffer(int bufferName)
Verifies whether the specified object name is a buffer name.
|
static boolean |
alIsEnabled(int target)
Queries whether a given capability is currently enabled or not.
|
static boolean |
alIsExtensionPresent(java.nio.ByteBuffer extName)
Verifies that a given extension is available for the current context and the device it is associated with.
|
static boolean |
alIsExtensionPresent(java.lang.CharSequence extName)
Verifies that a given extension is available for the current context and the device it is associated with.
|
static boolean |
alIsSource(int sourceName)
Verifies whether the specified object name is a source name.
|
static void |
alListener3f(int paramName,
float value1,
float value2,
float value3)
Sets the 3 dimensional float values of a listener parameter.
|
static void |
alListenerf(int paramName,
float value)
Sets the float value of a listener parameter.
|
static void |
alListenerfv(int paramName,
float[] values)
Array version of:
Listenerfv |
static void |
alListenerfv(int paramName,
java.nio.FloatBuffer values)
Pointer version of
Listenerf. |
static void |
alListeneri(int paramName,
int values)
Integer version of
Listenerf. |
static void |
alSource3f(int source,
int param,
float v1,
float v2,
float v3)
Sets the 3 dimensional values of a source parameter.
|
static void |
alSourcef(int source,
int param,
float value)
Sets the float value of a source parameter.
|
static void |
alSourcefv(int source,
int param,
float[] values)
Array version of:
Sourcefv |
static void |
alSourcefv(int source,
int param,
java.nio.FloatBuffer values)
Pointer version of
Sourcef. |
static void |
alSourcei(int source,
int param,
int value)
Integer version of
Sourcef. |
static void |
alSourcePause(int source)
Sets the source state to AL_PAUSED.
|
static void |
alSourcePausev(int[] sources)
Array version of:
SourcePausev |
static void |
alSourcePausev(java.nio.IntBuffer sources)
Pointer version of
SourcePause. |
static void |
alSourcePlay(int source)
Sets the source state to AL_PLAYING.
|
static void |
alSourcePlayv(int[] sources)
Array version of:
SourcePlayv |
static void |
alSourcePlayv(java.nio.IntBuffer sources)
Pointer version of
SourcePlay. |
static void |
alSourceQueueBuffers(int sourceName,
int bufferName)
Queues up one or multiple buffer names to the specified source.
|
static void |
alSourceQueueBuffers(int sourceName,
int[] bufferNames)
Array version of:
SourceQueueBuffers |
static void |
alSourceQueueBuffers(int sourceName,
java.nio.IntBuffer bufferNames)
Queues up one or multiple buffer names to the specified source.
|
static void |
alSourceRewind(int source)
Sets the source state to AL_INITIAL.
|
static void |
alSourceRewindv(int[] sources)
Array version of:
SourceRewindv |
static void |
alSourceRewindv(java.nio.IntBuffer sources)
Pointer version of
SourceRewind. |
static void |
alSourceStop(int source)
Sets the source state to AL_STOPPED.
|
static void |
alSourceStopv(int[] sources)
Array version of:
SourceStopv |
static void |
alSourceStopv(java.nio.IntBuffer sources)
Pointer version of
SourceStop. |
static int |
alSourceUnqueueBuffers(int sourceName)
Removes a number of buffer entries that have finished processing, in the order of apperance, from the queue of the specified source.
|
static void |
alSourceUnqueueBuffers(int sourceName,
int[] bufferNames)
Array version of:
SourceUnqueueBuffers |
static void |
alSourceUnqueueBuffers(int sourceName,
java.nio.IntBuffer bufferNames)
Removes a number of buffer entries that have finished processing, in the order of apperance, from the queue of the specified source.
|
static void |
nalBufferData(int bufferName,
int format,
long data,
int size,
int frequency)
Unsafe version of:
BufferData |
static void |
nalDeleteBuffers(int n,
long bufferNames)
Unsafe version of:
DeleteBuffers |
static void |
nalDeleteSources(int n,
long sources)
Unsafe version of:
DeleteSources |
static void |
nalGenBuffers(int n,
long bufferNames)
Unsafe version of:
GenBuffers |
static void |
nalGenSources(int n,
long srcNames)
Unsafe version of:
GenSources |
static void |
nalGetBooleanv(int paramName,
long dest)
Unsafe version of:
GetBooleanv |
static void |
nalGetBufferf(int bufferName,
int paramName,
long value)
Unsafe version of:
GetBufferf |
static void |
nalGetBufferi(int bufferName,
int paramName,
long value)
Unsafe version of:
GetBufferi |
static void |
nalGetDoublev(int paramName,
long dest)
Unsafe version of:
GetDoublev |
static int |
nalGetEnumValue(long enumName)
Unsafe version of:
GetEnumValue |
static void |
nalGetFloatv(int paramName,
long dest)
Unsafe version of:
GetFloatv |
static void |
nalGetIntegerv(int paramName,
long dest)
Unsafe version of:
GetIntegerv |
static void |
nalGetListener3f(int paramName,
long value1,
long value2,
long value3)
Unsafe version of:
GetListener3f |
static void |
nalGetListenerf(int paramName,
long value)
Unsafe version of:
GetListenerf |
static void |
nalGetListenerfv(int paramName,
long values)
Unsafe version of:
GetListenerfv |
static void |
nalGetListeneri(int paramName,
long value)
Unsafe version of:
GetListeneri |
static long |
nalGetProcAddress(long funcName)
Unsafe version of:
GetProcAddress |
static void |
nalGetSource3f(int source,
int param,
long v1,
long v2,
long v3)
Unsafe version of:
GetSource3f |
static void |
nalGetSourcef(int source,
int param,
long value)
Unsafe version of:
GetSourcef |
static void |
nalGetSourcefv(int source,
int param,
long values)
Unsafe version of:
GetSourcefv |
static void |
nalGetSourcei(int source,
int param,
long value)
Unsafe version of:
GetSourcei |
static void |
nalGetSourceiv(int source,
int param,
long values)
Unsafe version of:
GetSourceiv |
static long |
nalGetString(int paramName)
Unsafe version of:
GetString |
static boolean |
nalIsExtensionPresent(long extName)
Unsafe version of:
IsExtensionPresent |
static void |
nalListenerfv(int paramName,
long values)
Unsafe version of:
Listenerfv |
static void |
nalSourcefv(int source,
int param,
long values)
Unsafe version of:
Sourcefv |
static void |
nalSourcePausev(int n,
long sources)
Unsafe version of:
SourcePausev |
static void |
nalSourcePlayv(int n,
long sources)
Unsafe version of:
SourcePlayv |
static void |
nalSourceQueueBuffers(int sourceName,
int numBuffers,
long bufferNames)
Unsafe version of:
SourceQueueBuffers |
static void |
nalSourceRewindv(int n,
long sources)
Unsafe version of:
SourceRewindv |
static void |
nalSourceStopv(int n,
long sources)
Unsafe version of:
SourceStopv |
static void |
nalSourceUnqueueBuffers(int sourceName,
int numEntries,
long bufferNames)
Unsafe version of:
SourceUnqueueBuffers |
public static final int AL_INVALID
public static final int AL_NONE
public static final int AL_FALSE
public static final int AL_TRUE
public static final int AL_NO_ERROR
public static final int AL_INVALID_NAME
public static final int AL_INVALID_ENUM
public static final int AL_INVALID_VALUE
public static final int AL_INVALID_OPERATION
public static final int AL_OUT_OF_MEMORY
public static final int AL_DOPPLER_FACTOR
public static final int AL_DISTANCE_MODEL
public static final int AL_VENDOR
public static final int AL_VERSION
public static final int AL_RENDERER
public static final int AL_EXTENSIONS
public static final int AL_INVERSE_DISTANCE
public static final int AL_INVERSE_DISTANCE_CLAMPED
public static final int AL_SOURCE_ABSOLUTE
public static final int AL_SOURCE_RELATIVE
public static final int AL_POSITION
public static final int AL_VELOCITY
public static final int AL_GAIN
public static final int AL_CONE_INNER_ANGLE
public static final int AL_CONE_OUTER_ANGLE
public static final int AL_PITCH
public static final int AL_DIRECTION
public static final int AL_LOOPING
public static final int AL_BUFFER
public static final int AL_SOURCE_STATE
public static final int AL_CONE_OUTER_GAIN
public static final int AL_SOURCE_TYPE
public static final int AL_INITIAL
public static final int AL_PLAYING
public static final int AL_PAUSED
public static final int AL_STOPPED
public static final int AL_ORIENTATION
public static final int AL_BUFFERS_QUEUED
public static final int AL_BUFFERS_PROCESSED
public static final int AL_MIN_GAIN
public static final int AL_MAX_GAIN
public static final int AL_REFERENCE_DISTANCE
public static final int AL_ROLLOFF_FACTOR
public static final int AL_MAX_DISTANCE
public static final int AL_FREQUENCY
public static final int AL_BITS
public static final int AL_CHANNELS
public static final int AL_SIZE
public static final int AL_FORMAT_MONO8
public static final int AL_FORMAT_MONO16
public static final int AL_FORMAT_STEREO8
public static final int AL_FORMAT_STEREO16
public static final int AL_UNUSED
public static final int AL_PENDING
public static final int AL_PROCESSED
public static int alGetError()
Each detectable error is assigned a numeric code. When an error is detected by AL, a flag is set and the error code is recorded. Further errors, if they occur, do not affect this recorded code. When alGetError is called, the code is returned and the flag is cleared, so that a further error will again record its code. If a call to alGetError returns AL_NO_ERROR then there has been no detectable error since the last call to alGetError (or since the AL was initialized).
Error codes can be mapped to strings. The alGetString function returns a pointer to a constant (literal) string that is identical to the identifier used for the enumeration value, as defined in the specification.
public static void alEnable(int target)
target - the capability to enablepublic static void alDisable(int target)
target - the capability to disablepublic static boolean alIsEnabled(int target)
target - the capability to querypublic static boolean alGetBoolean(int paramName)
paramName - the parameter to querypublic static int alGetInteger(int paramName)
paramName - the parameter to query. One of:DOPPLER_FACTOR | DISTANCE_MODEL | SPEED_OF_SOUND |
public static float alGetFloat(int paramName)
paramName - the parameter to query. One of:DOPPLER_FACTOR | DISTANCE_MODEL | SPEED_OF_SOUND |
public static double alGetDouble(int paramName)
paramName - the parameter to query. One of:DOPPLER_FACTOR | DISTANCE_MODEL | SPEED_OF_SOUND |
public static void nalGetBooleanv(int paramName,
long dest)
GetBooleanvpublic static void alGetBooleanv(int paramName,
java.nio.ByteBuffer dest)
GetBoolean.paramName - the parameter to querydest - a buffer that will receive the parameter valuespublic static void nalGetIntegerv(int paramName,
long dest)
GetIntegervpublic static void alGetIntegerv(int paramName,
java.nio.IntBuffer dest)
GetInteger.paramName - the parameter to querydest - a buffer that will receive the parameter valuespublic static void nalGetFloatv(int paramName,
long dest)
GetFloatvpublic static void alGetFloatv(int paramName,
java.nio.FloatBuffer dest)
GetFloat.paramName - the parameter to querydest - a buffer that will receive the parameter valuespublic static void nalGetDoublev(int paramName,
long dest)
GetDoublevpublic static void alGetDoublev(int paramName,
java.nio.DoubleBuffer dest)
GetDouble.paramName - the parameter to querydest - a buffer that will receive the parameter valuespublic static long nalGetString(int paramName)
GetString@Nullable public static java.lang.String alGetString(int paramName)
paramName - the parameter to query. One of:VENDOR | VERSION | RENDERER | EXTENSIONS |
public static void alDistanceModel(int modelName)
Samples usually use the entire dynamic range of the chosen format/encoding, independent of their real world intensity. For example, a jet engine and a clockwork both will have samples with full amplitude. The application will then have to adjust source gain accordingly to account for relative differences.
Source gain is then attenuated by distance. The effective attenuation of a source depends on many factors, among which distance attenuation and source and listener gain are only some of the contributing factors. Even if the source and listener gain exceed 1.0 (amplification beyond the guaranteed dynamic range), distance and other attenuation might ultimately limit the overall gain to a value below 1.0.
OpenAL currently supports three modes of operation with respect to distance attenuation, including one that is similar to the IASIG I3DL2 model. The application can choose one of these models (or chooses to disable distance-dependent attenuation) on a per-context basis.
modelName - the distance attenuation model to set. One of:INVERSE_DISTANCE | INVERSE_DISTANCE_CLAMPED | LINEAR_DISTANCE | LINEAR_DISTANCE_CLAMPED |
EXPONENT_DISTANCE | EXPONENT_DISTANCE_CLAMPED | NONE |
public static void alDopplerFactor(float dopplerFactor)
The Doppler Effect depends on the velocities of source and listener relative to the medium, and the propagation speed of sound in that medium. The application might want to emphasize or de-emphasize the Doppler Effect as physically accurate calculation might not give the desired results. The amount of frequency shift (pitch change) is proportional to the speed of listener and source along their line of sight. The Doppler Effect as implemented by OpenAL is described by the formula below. Effects of the medium (air, water) moving with respect to listener and source are ignored.
SS: AL_SPEED_OF_SOUND = speed of sound (default value 343.3)
DF: AL_DOPPLER_FACTOR = Doppler factor (default 1.0)
vls: Listener velocity scalar (scalar, projected on source-to-listener vector)
vss: Source velocity scalar (scalar, projected on source-to-listener vector)
f: Frequency of sample
f': effective Doppler shifted frequency
3D Mathematical representation of vls and vss:
Mag(vector) = sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z)
DotProduct(v1, v2) = (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z)
SL = source to listener vector
SV = Source velocity vector
LV = Listener velocity vector
vls = DotProduct(SL, LV) / Mag(SL)
vss = DotProduct(SL, SV) / Mag(SL)
Dopper Calculation:
vss = min(vss, SS / DF)
vls = min(vls, SS / DF)
f' = f * (SS - DF * vls) / (SS - DF * vss)
The dopplerFactor is a simple scaling of source and listener velocities to exaggerate or deemphasize the Doppler (pitch) shift resulting from
the calculation.
dopplerFactor - the doppler factorpublic static void alDopplerVelocity(float dopplerVelocity)
The OpenAL 1.1 Doppler implementation is different than that of OpenAL 1.0, because the older implementation was confusing and not implemented consistently. The new "speed of sound" property makes the 1.1 implementation more intuitive than the old implementation. If your implementation wants to support the AL_DOPPLER_VELOCITY parameter (the alDopplerVelocity call will remain as an entry point so that 1.0 applications can link with a 1.1 library), the above formula can be changed to the following:
vss = min(vss, (SS * DV)/DF)
vls = min(vls, (SS * DV)/DF)
f' = f * (SS * DV - DF*vls) / (SS * DV - DF * vss)
OpenAL 1.1 programmers would never use AL_DOPPLER_VELOCITY (which defaults to 1.0).
dopplerVelocity - the doppler velocitypublic static void alListenerf(int paramName,
float value)
paramName - the parameter to modify. One of:ORIENTATION | POSITION | VELOCITY | GAIN |
value - the parameter valuepublic static void alListeneri(int paramName,
int values)
Listenerf.paramName - the parameter to modify. One of:ORIENTATION | POSITION | VELOCITY | GAIN |
values - the parameter valuepublic static void alListener3f(int paramName,
float value1,
float value2,
float value3)
paramName - the parameter to modify. One of:ORIENTATION | POSITION | VELOCITY | GAIN |
value1 - the first valuevalue2 - the second valuevalue3 - the third valuepublic static void nalListenerfv(int paramName,
long values)
Listenerfvpublic static void alListenerfv(int paramName,
java.nio.FloatBuffer values)
Listenerf.paramName - the parameter to modifyvalues - the parameter valuespublic static void nalGetListenerf(int paramName,
long value)
GetListenerfpublic static void alGetListenerf(int paramName,
java.nio.FloatBuffer value)
paramName - the parameter to query. One of:ORIENTATION | POSITION | VELOCITY | GAIN |
value - the parameter valuepublic static float alGetListenerf(int paramName)
paramName - the parameter to query. One of:ORIENTATION | POSITION | VELOCITY | GAIN |
public static void nalGetListeneri(int paramName,
long value)
GetListeneripublic static void alGetListeneri(int paramName,
java.nio.IntBuffer value)
paramName - the parameter to query. One of:ORIENTATION | POSITION | VELOCITY | GAIN |
value - the parameter valuepublic static int alGetListeneri(int paramName)
paramName - the parameter to query. One of:ORIENTATION | POSITION | VELOCITY | GAIN |
public static void nalGetListener3f(int paramName,
long value1,
long value2,
long value3)
GetListener3fpublic static void alGetListener3f(int paramName,
java.nio.FloatBuffer value1,
java.nio.FloatBuffer value2,
java.nio.FloatBuffer value3)
paramName - the parameter to query. One of:ORIENTATION | POSITION | VELOCITY | GAIN |
value1 - the first parameter valuevalue2 - the second parameter valuevalue3 - the third parameter valuepublic static void nalGetListenerfv(int paramName,
long values)
GetListenerfvpublic static void alGetListenerfv(int paramName,
java.nio.FloatBuffer values)
paramName - the parameter to query. One of:ORIENTATION | POSITION | VELOCITY | GAIN |
values - the parameter valuespublic static void nalGenSources(int n,
long srcNames)
GenSourcesn - the number of source names to generatedpublic static void alGenSources(java.nio.IntBuffer srcNames)
srcNames - the buffer that will receive the source namespublic static int alGenSources()
public static void nalDeleteSources(int n,
long sources)
DeleteSourcesn - the number of sources to deletepublic static void alDeleteSources(java.nio.IntBuffer sources)
sources - the sources to deletepublic static void alDeleteSources(int source)
public static boolean alIsSource(int sourceName)
sourceName - a value that may be a source namepublic static void alSourcef(int source,
int param,
float value)
source - the source to modifyparam - the parameter to modify. One of:CONE_INNER_ANGLE | CONE_OUTER_ANGLE | PITCH | DIRECTION | LOOPING | BUFFER | SOURCE_STATE |
CONE_OUTER_GAIN | SOURCE_TYPE | POSITION | VELOCITY | GAIN | REFERENCE_DISTANCE | ROLLOFF_FACTOR |
MAX_DISTANCE |
value - the parameter valuepublic static void alSource3f(int source,
int param,
float v1,
float v2,
float v3)
source - the source to modifyparam - the parameter to modify. One of:CONE_INNER_ANGLE | CONE_OUTER_ANGLE | PITCH | DIRECTION | LOOPING | BUFFER | SOURCE_STATE |
CONE_OUTER_GAIN | SOURCE_TYPE | POSITION | VELOCITY | GAIN | REFERENCE_DISTANCE | ROLLOFF_FACTOR |
MAX_DISTANCE |
v1 - the first parameter valuev2 - the second parameter valuev3 - the third parameter valuepublic static void nalSourcefv(int source,
int param,
long values)
Sourcefvpublic static void alSourcefv(int source,
int param,
java.nio.FloatBuffer values)
Sourcef.source - the source to modifyparam - the parameter to modifyvalues - the parameter valuespublic static void alSourcei(int source,
int param,
int value)
Sourcef.source - the source to modifyparam - the parameter to modifyvalue - the parameter valuepublic static void nalGetSourcef(int source,
int param,
long value)
GetSourcefpublic static void alGetSourcef(int source,
int param,
java.nio.FloatBuffer value)
source - the source to queryparam - the parameter to query. One of:CONE_INNER_ANGLE | CONE_OUTER_ANGLE | PITCH | DIRECTION | LOOPING | BUFFER | SOURCE_STATE |
CONE_OUTER_GAIN | SOURCE_TYPE | POSITION | VELOCITY | GAIN | REFERENCE_DISTANCE | ROLLOFF_FACTOR |
MAX_DISTANCE |
value - the parameter valuepublic static float alGetSourcef(int source,
int param)
source - the source to queryparam - the parameter to query. One of:CONE_INNER_ANGLE | CONE_OUTER_ANGLE | PITCH | DIRECTION | LOOPING | BUFFER | SOURCE_STATE |
CONE_OUTER_GAIN | SOURCE_TYPE | POSITION | VELOCITY | GAIN | REFERENCE_DISTANCE | ROLLOFF_FACTOR |
MAX_DISTANCE |
public static void nalGetSource3f(int source,
int param,
long v1,
long v2,
long v3)
GetSource3fpublic static void alGetSource3f(int source,
int param,
java.nio.FloatBuffer v1,
java.nio.FloatBuffer v2,
java.nio.FloatBuffer v3)
source - the source to queryparam - the parameter to query. One of:CONE_INNER_ANGLE | CONE_OUTER_ANGLE | PITCH | DIRECTION | LOOPING | BUFFER | SOURCE_STATE |
CONE_OUTER_GAIN | SOURCE_TYPE | POSITION | VELOCITY | GAIN | REFERENCE_DISTANCE | ROLLOFF_FACTOR |
MAX_DISTANCE |
v1 - the first parameter valuev2 - the second parameter valuev3 - the third parameter valuepublic static void nalGetSourcefv(int source,
int param,
long values)
GetSourcefvpublic static void alGetSourcefv(int source,
int param,
java.nio.FloatBuffer values)
source - the source to queryparam - the parameter to query. One of:CONE_INNER_ANGLE | CONE_OUTER_ANGLE | PITCH | DIRECTION | LOOPING | BUFFER | SOURCE_STATE |
CONE_OUTER_GAIN | SOURCE_TYPE | POSITION | VELOCITY | GAIN | REFERENCE_DISTANCE | ROLLOFF_FACTOR |
MAX_DISTANCE |
values - the parameter valuespublic static void nalGetSourcei(int source,
int param,
long value)
GetSourceipublic static void alGetSourcei(int source,
int param,
java.nio.IntBuffer value)
source - the source to queryparam - the parameter to query. One of:CONE_INNER_ANGLE | CONE_OUTER_ANGLE | PITCH | DIRECTION | LOOPING | BUFFER | SOURCE_STATE |
CONE_OUTER_GAIN | SOURCE_TYPE | POSITION | VELOCITY | GAIN | REFERENCE_DISTANCE | ROLLOFF_FACTOR |
MAX_DISTANCE |
value - the parameter valuepublic static int alGetSourcei(int source,
int param)
source - the source to queryparam - the parameter to query. One of:CONE_INNER_ANGLE | CONE_OUTER_ANGLE | PITCH | DIRECTION | LOOPING | BUFFER | SOURCE_STATE |
CONE_OUTER_GAIN | SOURCE_TYPE | POSITION | VELOCITY | GAIN | REFERENCE_DISTANCE | ROLLOFF_FACTOR |
MAX_DISTANCE |
public static void nalGetSourceiv(int source,
int param,
long values)
GetSourceivpublic static void alGetSourceiv(int source,
int param,
java.nio.IntBuffer values)
source - the source to queryparam - the parameter to query. One of:CONE_INNER_ANGLE | CONE_OUTER_ANGLE | PITCH | DIRECTION | LOOPING | BUFFER | SOURCE_STATE |
CONE_OUTER_GAIN | SOURCE_TYPE | POSITION | VELOCITY | GAIN | REFERENCE_DISTANCE | ROLLOFF_FACTOR |
MAX_DISTANCE |
values - the parameter valuespublic static void nalSourceQueueBuffers(int sourceName,
int numBuffers,
long bufferNames)
SourceQueueBuffersnumBuffers - the number of buffers to queuepublic static void alSourceQueueBuffers(int sourceName,
java.nio.IntBuffer bufferNames)
The buffers will be queued in the sequence in which they appear in the array. This command is legal on a source in any playback state (to allow for
streaming, queuing has to be possible on a AL_PLAYING source). All buffers in a queue must have the same format and attributes, with the exception of
the NULL buffer (i.e., 0) which can always be queued.
sourceName - the target sourcebufferNames - the buffer namespublic static void alSourceQueueBuffers(int sourceName,
int bufferName)
The buffers will be queued in the sequence in which they appear in the array. This command is legal on a source in any playback state (to allow for
streaming, queuing has to be possible on a AL_PLAYING source). All buffers in a queue must have the same format and attributes, with the exception of
the NULL buffer (i.e., 0) which can always be queued.
sourceName - the target sourcepublic static void nalSourceUnqueueBuffers(int sourceName,
int numEntries,
long bufferNames)
SourceUnqueueBuffersnumEntries - the number of buffers to unqueuepublic static void alSourceUnqueueBuffers(int sourceName,
java.nio.IntBuffer bufferNames)
Once a queue entry for a buffer has been appended to a queue and is pending processing, it should not be changed. Removal of a given queue entry is not possible unless either the source is stopped (in which case then entire queue is considered processed), or if the queue entry has already been processed (AL_PLAYING or AL_PAUSED source). A playing source will enter the AL_STOPPED state if it completes playback of the last buffer in its queue (the same behavior as when a single buffer has been attached to a source and has finished playback).
sourceName - the target sourcebufferNames - the buffer namespublic static int alSourceUnqueueBuffers(int sourceName)
Once a queue entry for a buffer has been appended to a queue and is pending processing, it should not be changed. Removal of a given queue entry is not possible unless either the source is stopped (in which case then entire queue is considered processed), or if the queue entry has already been processed (AL_PLAYING or AL_PAUSED source). A playing source will enter the AL_STOPPED state if it completes playback of the last buffer in its queue (the same behavior as when a single buffer has been attached to a source and has finished playback).
sourceName - the target sourcepublic static void alSourcePlay(int source)
alSourcePlay applied to an AL_INITIAL source will promote the source to AL_PLAYING, thus the data found in the buffer will be fed into the processing, starting at the beginning. alSourcePlay applied to a AL_PLAYING source will restart the source from the beginning. It will not affect the configuration, and will leave the source in AL_PLAYING state, but reset the sampling offset to the beginning. alSourcePlay applied to a AL_PAUSED source will resume processing using the source state as preserved at the alSourcePause operation. alSourcePlay applied to a AL_STOPPED source will propagate it to AL_INITIAL then to AL_PLAYING immediately.
source - the source to playpublic static void alSourcePause(int source)
alSourcePause applied to an AL_INITIAL source is a legal NOP. alSourcePause applied to a AL_PLAYING source will change its state to AL_PAUSED. The source is exempt from processing, its current state is preserved. alSourcePause applied to a AL_PAUSED source is a legal NOP. alSourcePause applied to a AL_STOPPED source is a legal NOP.
source - the source to pausepublic static void alSourceStop(int source)
alSourceStop applied to an AL_INITIAL source is a legal NOP. alSourceStop applied to a AL_PLAYING source will change its state to AL_STOPPED. The source is exempt from processing, its current state is preserved. alSourceStop applied to a AL_PAUSED source will change its state to AL_STOPPED, with the same consequences as on a AL_PLAYING source. alSourceStop applied to a AL_STOPPED source is a legal NOP.
source - the source to stoppublic static void alSourceRewind(int source)
alSourceRewind applied to an AL_INITIAL source is a legal NOP. alSourceRewind applied to a AL_PLAYING source will change its state to AL_STOPPED then AL_INITIAL. The source is exempt from processing: its current state is preserved, with the exception of the sampling offset, which is reset to the beginning. alSourceRewind applied to a AL_PAUSED source will change its state to AL_INITIAL, with the same consequences as on a AL_PLAYING source. alSourceRewind applied to an AL_STOPPED source promotes the source to AL_INITIAL, resetting the sampling offset to the beginning.
source - the source to rewindpublic static void nalSourcePlayv(int n,
long sources)
SourcePlayvn - the number of sources to playpublic static void alSourcePlayv(java.nio.IntBuffer sources)
SourcePlay.sources - the sources to playpublic static void nalSourcePausev(int n,
long sources)
SourcePausevn - the number of sources to pausepublic static void alSourcePausev(java.nio.IntBuffer sources)
SourcePause.sources - the sources to pausepublic static void nalSourceStopv(int n,
long sources)
SourceStopvn - the number of sources to stoppublic static void alSourceStopv(java.nio.IntBuffer sources)
SourceStop.sources - the sources to stoppublic static void nalSourceRewindv(int n,
long sources)
SourceRewindvn - the number of sources to rewindpublic static void alSourceRewindv(java.nio.IntBuffer sources)
SourceRewind.sources - the sources to rewindpublic static void nalGenBuffers(int n,
long bufferNames)
GenBuffersn - the number of buffer names to generatepublic static void alGenBuffers(java.nio.IntBuffer bufferNames)
bufferNames - the buffer that will receive the buffer namespublic static int alGenBuffers()
public static void nalDeleteBuffers(int n,
long bufferNames)
DeleteBuffersn - the number of buffers to deletepublic static void alDeleteBuffers(java.nio.IntBuffer bufferNames)
bufferNames - the buffers to deletepublic static void alDeleteBuffers(int bufferName)
public static boolean alIsBuffer(int bufferName)
bufferName - a value that may be a buffer namepublic static void nalGetBufferf(int bufferName,
int paramName,
long value)
GetBufferfpublic static void alGetBufferf(int bufferName,
int paramName,
java.nio.FloatBuffer value)
public static float alGetBufferf(int bufferName,
int paramName)
public static void nalGetBufferi(int bufferName,
int paramName,
long value)
GetBufferipublic static void alGetBufferi(int bufferName,
int paramName,
java.nio.IntBuffer value)
public static int alGetBufferi(int bufferName,
int paramName)
public static void nalBufferData(int bufferName,
int format,
long data,
int size,
int frequency)
BufferDatasize - the data buffer size, in bytespublic static void alBufferData(int bufferName,
int format,
java.nio.ByteBuffer data,
int frequency)
The data specified is copied to an internal software, or if possible, hardware buffer. The implementation is free to apply decompression, conversion, resampling, and filtering as needed.
8-bit data is expressed as an unsigned value over the range 0 to 255, 128 being an audio output level of zero.
16-bit data is expressed as a signed value over the range -32768 to 32767, 0 being an audio output level of zero. Byte order for 16-bit values is determined by the native format of the CPU.
Stereo data is expressed in an interleaved format, left channel sample followed by the right channel sample.
Buffers containing audio data with more than one channel will be played without 3D spatialization features – these formats are normally used for background music.
bufferName - the buffer to modifyformat - the data format. One of:FORMAT_MONO8 | FORMAT_MONO16 | FORMAT_STEREO8 | FORMAT_STEREO16 |
data - the sample datafrequency - the data frequencypublic static void alBufferData(int bufferName,
int format,
java.nio.ShortBuffer data,
int frequency)
The data specified is copied to an internal software, or if possible, hardware buffer. The implementation is free to apply decompression, conversion, resampling, and filtering as needed.
8-bit data is expressed as an unsigned value over the range 0 to 255, 128 being an audio output level of zero.
16-bit data is expressed as a signed value over the range -32768 to 32767, 0 being an audio output level of zero. Byte order for 16-bit values is determined by the native format of the CPU.
Stereo data is expressed in an interleaved format, left channel sample followed by the right channel sample.
Buffers containing audio data with more than one channel will be played without 3D spatialization features – these formats are normally used for background music.
bufferName - the buffer to modifyformat - the data format. One of:FORMAT_MONO8 | FORMAT_MONO16 | FORMAT_STEREO8 | FORMAT_STEREO16 |
data - the sample datafrequency - the data frequencypublic static void alBufferData(int bufferName,
int format,
java.nio.IntBuffer data,
int frequency)
The data specified is copied to an internal software, or if possible, hardware buffer. The implementation is free to apply decompression, conversion, resampling, and filtering as needed.
8-bit data is expressed as an unsigned value over the range 0 to 255, 128 being an audio output level of zero.
16-bit data is expressed as a signed value over the range -32768 to 32767, 0 being an audio output level of zero. Byte order for 16-bit values is determined by the native format of the CPU.
Stereo data is expressed in an interleaved format, left channel sample followed by the right channel sample.
Buffers containing audio data with more than one channel will be played without 3D spatialization features – these formats are normally used for background music.
bufferName - the buffer to modifyformat - the data format. One of:FORMAT_MONO8 | FORMAT_MONO16 | FORMAT_STEREO8 | FORMAT_STEREO16 |
data - the sample datafrequency - the data frequencypublic static void alBufferData(int bufferName,
int format,
java.nio.FloatBuffer data,
int frequency)
The data specified is copied to an internal software, or if possible, hardware buffer. The implementation is free to apply decompression, conversion, resampling, and filtering as needed.
8-bit data is expressed as an unsigned value over the range 0 to 255, 128 being an audio output level of zero.
16-bit data is expressed as a signed value over the range -32768 to 32767, 0 being an audio output level of zero. Byte order for 16-bit values is determined by the native format of the CPU.
Stereo data is expressed in an interleaved format, left channel sample followed by the right channel sample.
Buffers containing audio data with more than one channel will be played without 3D spatialization features – these formats are normally used for background music.
bufferName - the buffer to modifyformat - the data format. One of:FORMAT_MONO8 | FORMAT_MONO16 | FORMAT_STEREO8 | FORMAT_STEREO16 |
data - the sample datafrequency - the data frequencypublic static int nalGetEnumValue(long enumName)
GetEnumValuepublic static int alGetEnumValue(java.nio.ByteBuffer enumName)
enumName - the enum namepublic static int alGetEnumValue(java.lang.CharSequence enumName)
enumName - the enum namepublic static long nalGetProcAddress(long funcName)
GetProcAddresspublic static long alGetProcAddress(java.nio.ByteBuffer funcName)
Returns NULL if no entry point with the name funcName can be found. Implementations are free to return NULL if an entry point is present, but not
applicable for the current context. However the specification does not guarantee this behavior.
Applications can use alGetProcAddress to obtain core API entry points, not just extensions. This is the recommended way to dynamically load and unload OpenAL DLL's as sound drivers.
funcName - the function namepublic static long alGetProcAddress(java.lang.CharSequence funcName)
Returns NULL if no entry point with the name funcName can be found. Implementations are free to return NULL if an entry point is present, but not
applicable for the current context. However the specification does not guarantee this behavior.
Applications can use alGetProcAddress to obtain core API entry points, not just extensions. This is the recommended way to dynamically load and unload OpenAL DLL's as sound drivers.
funcName - the function namepublic static boolean nalIsExtensionPresent(long extName)
IsExtensionPresentpublic static boolean alIsExtensionPresent(java.nio.ByteBuffer extName)
Invalid and unsupported string tokens return ALC_FALSE. extName is not case sensitive – the implementation will convert the name to all
upper-case internally (and will express extension names in upper-case).
extName - the extension namepublic static boolean alIsExtensionPresent(java.lang.CharSequence extName)
Invalid and unsupported string tokens return ALC_FALSE. extName is not case sensitive – the implementation will convert the name to all
upper-case internally (and will express extension names in upper-case).
extName - the extension namepublic static void alGetIntegerv(int paramName,
int[] dest)
GetIntegervpublic static void alGetFloatv(int paramName,
float[] dest)
GetFloatvpublic static void alGetDoublev(int paramName,
double[] dest)
GetDoublevpublic static void alListenerfv(int paramName,
float[] values)
Listenerfvpublic static void alGetListenerf(int paramName,
float[] value)
GetListenerfpublic static void alGetListeneri(int paramName,
int[] value)
GetListeneripublic static void alGetListener3f(int paramName,
float[] value1,
float[] value2,
float[] value3)
GetListener3fpublic static void alGetListenerfv(int paramName,
float[] values)
GetListenerfvpublic static void alGenSources(int[] srcNames)
GenSourcespublic static void alDeleteSources(int[] sources)
DeleteSourcespublic static void alSourcefv(int source,
int param,
float[] values)
Sourcefvpublic static void alGetSourcef(int source,
int param,
float[] value)
GetSourcefpublic static void alGetSource3f(int source,
int param,
float[] v1,
float[] v2,
float[] v3)
GetSource3fpublic static void alGetSourcefv(int source,
int param,
float[] values)
GetSourcefvpublic static void alGetSourcei(int source,
int param,
int[] value)
GetSourceipublic static void alGetSourceiv(int source,
int param,
int[] values)
GetSourceivpublic static void alSourceQueueBuffers(int sourceName,
int[] bufferNames)
SourceQueueBufferspublic static void alSourceUnqueueBuffers(int sourceName,
int[] bufferNames)
SourceUnqueueBufferspublic static void alSourcePlayv(int[] sources)
SourcePlayvpublic static void alSourcePausev(int[] sources)
SourcePausevpublic static void alSourceStopv(int[] sources)
SourceStopvpublic static void alSourceRewindv(int[] sources)
SourceRewindvpublic static void alGenBuffers(int[] bufferNames)
GenBufferspublic static void alDeleteBuffers(int[] bufferNames)
DeleteBufferspublic static void alGetBufferf(int bufferName,
int paramName,
float[] value)
GetBufferfpublic static void alGetBufferi(int bufferName,
int paramName,
int[] value)
GetBufferipublic static void alBufferData(int bufferName,
int format,
short[] data,
int frequency)
BufferDatapublic static void alBufferData(int bufferName,
int format,
int[] data,
int frequency)
BufferDatapublic static void alBufferData(int bufferName,
int format,
float[] data,
int frequency)
BufferDataCopyright LWJGL. All Rights Reserved. License terms.