Class LwjglAL
- All Implemented Interfaces:
AL
-
Field Summary
Fields inherited from interface com.jme3.audio.openal.AL
AL_BITS, AL_BUFFER, AL_BUFFERS_PROCESSED, AL_BUFFERS_QUEUED, AL_BYTE_OFFSET, AL_CHANNELS, AL_CONE_INNER_ANGLE, AL_CONE_OUTER_ANGLE, AL_CONE_OUTER_GAIN, AL_DIRECTION, AL_DISTANCE_MODEL, AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, AL_EXPONENT_DISTANCE, AL_EXPONENT_DISTANCE_CLAMPED, AL_EXTENSIONS, AL_FALSE, AL_FORMAT_MONO16, AL_FORMAT_MONO8, AL_FORMAT_STEREO16, AL_FORMAT_STEREO8, AL_FREQUENCY, AL_GAIN, AL_INITIAL, AL_INVALID_ENUM, AL_INVALID_NAME, AL_INVALID_OPERATION, AL_INVALID_VALUE, AL_INVERSE_DISTANCE, AL_INVERSE_DISTANCE_CLAMPED, AL_LINEAR_DISTANCE, AL_LINEAR_DISTANCE_CLAMPED, AL_LOOPING, AL_MAX_DISTANCE, AL_MAX_GAIN, AL_MIN_GAIN, AL_NO_ERROR, AL_NONE, AL_ORIENTATION, AL_OUT_OF_MEMORY, AL_PAUSED, AL_PENDING, AL_PITCH, AL_PLAYING, AL_POSITION, AL_PROCESSED, AL_REFERENCE_DISTANCE, AL_RENDERER, AL_ROLLOFF_FACTOR, AL_SAMPLE_OFFSET, AL_SEC_OFFSET, AL_SIZE, AL_SOURCE_RELATIVE, AL_SOURCE_STATE, AL_SOURCE_TYPE, AL_SPEED_OF_SOUND, AL_STATIC, AL_STOPPED, AL_STREAMING, AL_TRUE, AL_UNDETERMINED, AL_UNUSED, AL_VELOCITY, AL_VENDOR, AL_VERSION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
alBufferData
(int buffer, int format, ByteBuffer data, int size, int frequency) Sets the sample data of the specified buffer.void
alDeleteBuffers
(int numBuffers, IntBuffer buffers) Requests the deletion of a number of buffers.void
alDeleteSources
(int numSources, IntBuffer sources) Requests the deletion of a number of sources.void
alGenBuffers
(int numBuffers, IntBuffer buffers) Requests a number of buffer names.int
Requests a number of source names.int
Obtains error information.int
alGetSourcei
(int source, int param) Returns the integer value of the specified source parameter.alGetString
(int parameter) void
alListener
(int param, FloatBuffer data) Pointer version ofListenerf
.void
alListener3f
(int param, float value1, float value2, float value3) Sets the 3 dimensional float values of a listener parameter.void
alListenerf
(int param, float value) Sets the float value of a listener parameter.void
alSource3f
(int source, int param, float value1, float value2, float value3) Sets the 3 dimensional values of a source parameter.void
alSource3i
(int source, int param, int value1, int value2, int value3) Sets the 3 dimensional integer values of a source parameter.void
alSourcef
(int source, int param, float value) Sets the float value of a source parameter.void
alSourcei
(int source, int param, int value) Integer version ofSourcef
.void
alSourcePause
(int source) Sets the source state to AL_PAUSED.void
alSourcePlay
(int source) Sets the source state to AL_PLAYING.void
alSourceQueueBuffers
(int source, int numBuffers, IntBuffer buffers) Queues up one or multiple buffer names to the specified source.void
alSourceStop
(int source) Sets the source state to AL_STOPPED.void
alSourceUnqueueBuffers
(int source, int numBuffers, IntBuffer buffers) Removes a number of buffer entries that have finished processing, in the order of appearance, from the queue of the specified source.
-
Constructor Details
-
LwjglAL
public LwjglAL()
-
-
Method Details
-
alGetString
- Specified by:
alGetString
in interfaceAL
-
alGenSources
public int alGenSources()Description copied from interface:AL
Requests a number of source names.- Specified by:
alGenSources
in interfaceAL
- Returns:
- the number of source names.
-
alGetError
public int alGetError()Description copied from interface:AL
Obtains error information.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.
- Specified by:
alGetError
in interfaceAL
- Returns:
- the error code, or AL_NO_ERROR if none
-
alDeleteSources
Description copied from interface:AL
Requests the deletion of a number of sources.- Specified by:
alDeleteSources
in interfaceAL
- Parameters:
numSources
- the number of sources.sources
- the sources to delete.
-
alGenBuffers
Description copied from interface:AL
Requests a number of buffer names.- Specified by:
alGenBuffers
in interfaceAL
- Parameters:
numBuffers
- the number of buffers.buffers
- the buffer that will receive the buffer names.
-
alDeleteBuffers
Description copied from interface:AL
Requests the deletion of a number of buffers.- Specified by:
alDeleteBuffers
in interfaceAL
- Parameters:
numBuffers
- the number of buffers.buffers
- the buffers to delete.
-
alSourceStop
public void alSourceStop(int source) Description copied from interface:AL
Sets the source state to AL_STOPPED.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.
- Specified by:
alSourceStop
in interfaceAL
- Parameters:
source
- the source to stop.
-
alSourcei
public void alSourcei(int source, int param, int value) Description copied from interface:AL
Integer version ofSourcef
. -
alBufferData
Description copied from interface:AL
Sets the sample data of the specified buffer.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.
- Specified by:
alBufferData
in interfaceAL
- Parameters:
buffer
- the buffer to modify.format
- the data format. One of:FORMAT_MONO8
FORMAT_MONO16
FORMAT_STEREO8
FORMAT_STEREO16
data
- the sample data.size
- the length of the data (in bytes, ≥0)frequency
- the data frequency.
-
alSourcePlay
public void alSourcePlay(int source) Description copied from interface:AL
Sets the source state to AL_PLAYING.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.
- Specified by:
alSourcePlay
in interfaceAL
- Parameters:
source
- the source to play.
-
alSourcePause
public void alSourcePause(int source) Description copied from interface:AL
Sets the source state to AL_PAUSED.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.
- Specified by:
alSourcePause
in interfaceAL
- Parameters:
source
- the source to pause.
-
alSourcef
public void alSourcef(int source, int param, float value) Description copied from interface:AL
Sets the float value of a source parameter.- Specified by:
alSourcef
in interfaceAL
- Parameters:
source
- the source to modify.param
- 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 value.
-
alSource3f
public void alSource3f(int source, int param, float value1, float value2, float value3) Description copied from interface:AL
Sets the 3 dimensional values of a source parameter.- Specified by:
alSource3f
in interfaceAL
- Parameters:
source
- the source to modify.param
- 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
value1
- the first parameter value.value2
- the second parameter value.value3
- the third parameter value.
-
alGetSourcei
public int alGetSourcei(int source, int param) Description copied from interface:AL
Returns the integer value of the specified source parameter.- Specified by:
alGetSourcei
in interfaceAL
- Parameters:
source
- the source to query.param
- 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
- Returns:
- the parameter value
-
alSourceUnqueueBuffers
Description copied from interface:AL
Removes a number of buffer entries that have finished processing, in the order of appearance, from the queue of the specified source.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).
- Specified by:
alSourceUnqueueBuffers
in interfaceAL
- Parameters:
source
- the target sourcenumBuffers
- the names count.buffers
- the buffer names
-
alSourceQueueBuffers
Description copied from interface:AL
Queues up one or multiple buffer names to the specified source.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.- Specified by:
alSourceQueueBuffers
in interfaceAL
- Parameters:
source
- the target source.numBuffers
- the names count.buffers
- the buffer names.
-
alListener
Description copied from interface:AL
Pointer version ofListenerf
.- Specified by:
alListener
in interfaceAL
- Parameters:
param
- the parameter to modify.data
- the parameter values.
-
alListenerf
public void alListenerf(int param, float value) Description copied from interface:AL
Sets the float value of a listener parameter.- Specified by:
alListenerf
in interfaceAL
- Parameters:
param
- the parameter to modify. One of:ORIENTATION
POSITION
VELOCITY
GAIN
value
- the parameter value.
-
alListener3f
public void alListener3f(int param, float value1, float value2, float value3) Description copied from interface:AL
Sets the 3 dimensional float values of a listener parameter.- Specified by:
alListener3f
in interfaceAL
- Parameters:
param
- the parameter to modify. One of:ORIENTATION
POSITION
VELOCITY
GAIN
value1
- the first value.value2
- the second value.value3
- the third value.
-
alSource3i
public void alSource3i(int source, int param, int value1, int value2, int value3) Description copied from interface:AL
Sets the 3 dimensional integer values of a source parameter.- Specified by:
alSource3i
in interfaceAL
- Parameters:
source
- the source to modify.param
- the parameter to modify.value1
- the first value.value2
- the second value.value3
- the third value.
-