Interface AL

All Known Implementing Classes:
AndroidAL, IosAL, LwjglAL

public interface AL
  • Field Details

    • AL_FALSE

      static final int AL_FALSE
      Boolean False.
      See Also:
    • AL_TRUE

      static final int AL_TRUE
      Boolean True.
      See Also:
    • AL_NONE

      static final int AL_NONE
      See Also:
    • AL_SOURCE_RELATIVE

      static final int AL_SOURCE_RELATIVE
      Indicate Source has relative coordinates.
      See Also:
    • AL_CONE_INNER_ANGLE

      static final int AL_CONE_INNER_ANGLE
      Directional source, inner cone angle, in degrees. Range: [0-360] Default: 360
      See Also:
    • AL_CONE_OUTER_ANGLE

      static final int AL_CONE_OUTER_ANGLE
      Directional source, outer cone angle, in degrees. Range: [0-360] Default: 360
      See Also:
    • AL_PITCH

      static final int AL_PITCH
      Specify the pitch to be applied at source. Range: [0.5-2.0] Default: 1.0
      See Also:
    • AL_POSITION

      static final int AL_POSITION
      Specify the current location in three-dimensional space. OpenAL, like OpenGL, uses a right-handed coordinate system, where in a frontal default view X (thumb) points right, Y points up (index finger), and Z points towards the viewer/camera (middle finger). To switch from a left-handed coordinate system, flip the sign of the Z coordinate. Listener position is always in the world coordinate system.
      See Also:
    • AL_DIRECTION

      static final int AL_DIRECTION
      Specify the current direction.
      See Also:
    • AL_VELOCITY

      static final int AL_VELOCITY
      Specify the current velocity in three-dimensional space.
      See Also:
    • AL_LOOPING

      static final int AL_LOOPING
      Indicate whether source is looping. Type: ALboolean? Range: [AL_TRUE, AL_FALSE] Default: FALSE.
      See Also:
    • AL_BUFFER

      static final int AL_BUFFER
      Indicate the buffer to provide sound samples. Type: ALuint. Range: any valid Buffer id.
      See Also:
    • AL_GAIN

      static final int AL_GAIN
      Indicate the gain (volume amplification) applied. Type: ALfloat. Range: ]0.0- ] A value of 1.0 means un-attenuated/unchanged. Each division by 2 equals an attenuation of -6dB. Each multiplication by 2 equals an amplification of +6dB. A value of 0.0 is meaningless with respect to a logarithmic scale; it is interpreted as zero volume - the channel is effectively disabled.
      See Also:
    • AL_MIN_GAIN

      static final int AL_MIN_GAIN
      Indicate minimum source attenuation Type: ALfloat Range: [0.0 - 1.0] Logarithmic
      See Also:
    • AL_MAX_GAIN

      static final int AL_MAX_GAIN
      Indicate maximum source attenuation Type: ALfloat Range: [0.0 - 1.0] Logarithmic
      See Also:
    • AL_ORIENTATION

      static final int AL_ORIENTATION
      Indicate listener orientation. at/up
      See Also:
    • AL_SOURCE_STATE

      static final int AL_SOURCE_STATE
      Source state information.
      See Also:
    • AL_INITIAL

      static final int AL_INITIAL
      See Also:
    • AL_PLAYING

      static final int AL_PLAYING
      See Also:
    • AL_PAUSED

      static final int AL_PAUSED
      See Also:
    • AL_STOPPED

      static final int AL_STOPPED
      See Also:
    • AL_BUFFERS_QUEUED

      static final int AL_BUFFERS_QUEUED
      Buffer Queue params
      See Also:
    • AL_BUFFERS_PROCESSED

      static final int AL_BUFFERS_PROCESSED
      See Also:
    • AL_SEC_OFFSET

      static final int AL_SEC_OFFSET
      Source buffer position information
      See Also:
    • AL_SAMPLE_OFFSET

      static final int AL_SAMPLE_OFFSET
      See Also:
    • AL_BYTE_OFFSET

      static final int AL_BYTE_OFFSET
      See Also:
    • AL_SOURCE_TYPE

      static final int AL_SOURCE_TYPE
      Source type (Static, Streaming or undetermined) Source is Static if a Buffer has been attached using AL_BUFFER Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers Source is undetermined when it has the NULL buffer attached
      See Also:
    • AL_STATIC

      static final int AL_STATIC
      See Also:
    • AL_STREAMING

      static final int AL_STREAMING
      See Also:
    • AL_UNDETERMINED

      static final int AL_UNDETERMINED
      See Also:
    • AL_FORMAT_MONO8

      static final int AL_FORMAT_MONO8
      Sound samples: format specifier.
      See Also:
    • AL_FORMAT_MONO16

      static final int AL_FORMAT_MONO16
      See Also:
    • AL_FORMAT_STEREO8

      static final int AL_FORMAT_STEREO8
      See Also:
    • AL_FORMAT_STEREO16

      static final int AL_FORMAT_STEREO16
      See Also:
    • AL_REFERENCE_DISTANCE

      static final int AL_REFERENCE_DISTANCE
      source specific reference distance Type: ALfloat Range: 0.0 - +inf At 0.0, no distance attenuation occurs. Default is 1.0.
      See Also:
    • AL_ROLLOFF_FACTOR

      static final int AL_ROLLOFF_FACTOR
      source specific rolloff factor Type: ALfloat Range: 0.0 - +inf
      See Also:
    • AL_CONE_OUTER_GAIN

      static final int AL_CONE_OUTER_GAIN
      Directional source, outer cone gain. Default: 0.0 Range: [0.0 - 1.0] Logarithmic
      See Also:
    • AL_MAX_DISTANCE

      static final int AL_MAX_DISTANCE
      Indicate distance above which sources are not attenuated using the inverse clamped distance model. Default: +inf Type: ALfloat Range: 0.0 - +inf
      See Also:
    • AL_FREQUENCY

      static final int AL_FREQUENCY
      Sound samples: frequency, in units of Hertz [Hz]. This is the number of samples per second. Half of the sample frequency marks the maximum significant frequency component.
      See Also:
    • AL_BITS

      static final int AL_BITS
      See Also:
    • AL_CHANNELS

      static final int AL_CHANNELS
      See Also:
    • AL_SIZE

      static final int AL_SIZE
      See Also:
    • AL_UNUSED

      static final int AL_UNUSED
      Buffer state. Not supported for public use (yet).
      See Also:
    • AL_PENDING

      static final int AL_PENDING
      See Also:
    • AL_PROCESSED

      static final int AL_PROCESSED
      See Also:
    • AL_NO_ERROR

      static final int AL_NO_ERROR
      Errors: No Error.
      See Also:
    • AL_INVALID_NAME

      static final int AL_INVALID_NAME
      Invalid Name parameter passed to AL call.
      See Also:
    • AL_INVALID_ENUM

      static final int AL_INVALID_ENUM
      Invalid parameter passed to AL call.
      See Also:
    • AL_INVALID_VALUE

      static final int AL_INVALID_VALUE
      Invalid enum parameter value.
      See Also:
    • AL_INVALID_OPERATION

      static final int AL_INVALID_OPERATION
      Illegal call.
      See Also:
    • AL_OUT_OF_MEMORY

      static final int AL_OUT_OF_MEMORY
      No mojo.
      See Also:
    • AL_VENDOR

      static final int AL_VENDOR
      Context strings: Vendor Name.
      See Also:
    • AL_VERSION

      static final int AL_VERSION
      See Also:
    • AL_RENDERER

      static final int AL_RENDERER
      See Also:
    • AL_EXTENSIONS

      static final int AL_EXTENSIONS
      See Also:
    • AL_DOPPLER_FACTOR

      static final int AL_DOPPLER_FACTOR
      Doppler scale. Default 1.0
      See Also:
    • AL_DOPPLER_VELOCITY

      static final int AL_DOPPLER_VELOCITY
      Tweaks speed of propagation.
      See Also:
    • AL_SPEED_OF_SOUND

      static final int AL_SPEED_OF_SOUND
      Speed of Sound in units per second
      See Also:
    • AL_DISTANCE_MODEL

      static final int AL_DISTANCE_MODEL
      Distance models used in conjunction with DistanceModel implicit: NONE, which disables distance attenuation.
      See Also:
    • AL_INVERSE_DISTANCE

      static final int AL_INVERSE_DISTANCE
      See Also:
    • AL_INVERSE_DISTANCE_CLAMPED

      static final int AL_INVERSE_DISTANCE_CLAMPED
      See Also:
    • AL_LINEAR_DISTANCE

      static final int AL_LINEAR_DISTANCE
      See Also:
    • AL_LINEAR_DISTANCE_CLAMPED

      static final int AL_LINEAR_DISTANCE_CLAMPED
      See Also:
    • AL_EXPONENT_DISTANCE

      static final int AL_EXPONENT_DISTANCE
      See Also:
    • AL_EXPONENT_DISTANCE_CLAMPED

      static final int AL_EXPONENT_DISTANCE_CLAMPED
      See Also:
  • Method Details

    • alGetString

      String alGetString(int parameter)
    • alGenSources

      int alGenSources()
      Requests a number of source names.
      Returns:
      the number of source names.
    • alGetError

      int alGetError()
      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.

      Returns:
      the error code, or AL_NO_ERROR if none
    • alDeleteSources

      void alDeleteSources(int numSources, IntBuffer sources)
      Requests the deletion of a number of sources.
      Parameters:
      numSources - the number of sources.
      sources - the sources to delete.
    • alGenBuffers

      void alGenBuffers(int numBuffers, IntBuffer buffers)
      Requests a number of buffer names.
      Parameters:
      numBuffers - the number of buffers.
      buffers - the buffer that will receive the buffer names.
    • alDeleteBuffers

      void alDeleteBuffers(int numBuffers, IntBuffer buffers)
      Requests the deletion of a number of buffers.
      Parameters:
      numBuffers - the number of buffers.
      buffers - the buffers to delete.
    • alSourceStop

      void alSourceStop(int source)
      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.

      Parameters:
      source - the source to stop.
    • alSourcei

      void alSourcei(int source, int param, int value)
      Integer version of Sourcef.
      Parameters:
      source - the source to modify.
      param - the parameter to modify.
      value - the parameter value.
    • alBufferData

      void alBufferData(int buffer, int format, ByteBuffer data, int size, int frequency)
      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.

      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

      void alSourcePlay(int source)
      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.

      Parameters:
      source - the source to play.
    • alSourcePause

      void alSourcePause(int source)
      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.

      Parameters:
      source - the source to pause.
    • alSourcef

      void alSourcef(int source, int param, float value)
      Sets the float value of a source parameter.
      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

      void alSource3f(int source, int param, float value1, float value2, float value3)
      Sets the 3 dimensional values of a source parameter.
      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

      int alGetSourcei(int source, int param)
      Returns the integer value of the specified source parameter.
      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

      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.

      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).

      Parameters:
      source - the target source
      numBuffers - the names count.
      buffers - the buffer names
    • alSourceQueueBuffers

      void alSourceQueueBuffers(int source, int numBuffers, IntBuffer buffers)
      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.

      Parameters:
      source - the target source.
      numBuffers - the names count.
      buffers - the buffer names.
    • alListener

      void alListener(int param, FloatBuffer data)
      Pointer version of Listenerf.
      Parameters:
      param - the parameter to modify.
      data - the parameter values.
    • alListenerf

      void alListenerf(int param, float value)
      Sets the float value of a listener parameter.
      Parameters:
      param - the parameter to modify. One of: ORIENTATION POSITION VELOCITY GAIN
      value - the parameter value.
    • alListener3f

      void alListener3f(int param, float value1, float value2, float value3)
      Sets the 3 dimensional float values of a listener parameter.
      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

      void alSource3i(int source, int param, int value1, int value2, int value3)
      Sets the 3 dimensional integer values of a source parameter.
      Parameters:
      source - the source to modify.
      param - the parameter to modify.
      value1 - the first value.
      value2 - the second value.
      value3 - the third value.