Class AndroidAL

java.lang.Object
com.jme3.audio.android.AndroidAL
All Implemented Interfaces:
AL

public final class AndroidAL extends Object implements AL
  • Constructor Details

    • AndroidAL

      public AndroidAL()
  • Method Details

    • alGetString

      public String alGetString(int parameter)
      Specified by:
      alGetString in interface AL
    • alGenSources

      public int alGenSources()
      Description copied from interface: AL
      Requests a number of source names.
      Specified by:
      alGenSources in interface AL
      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 interface AL
      Returns:
      the error code, or AL_NO_ERROR if none
    • alDeleteSources

      public void alDeleteSources(int numSources, IntBuffer sources)
      Description copied from interface: AL
      Requests the deletion of a number of sources.
      Specified by:
      alDeleteSources in interface AL
      Parameters:
      numSources - the number of sources.
      sources - the sources to delete.
    • alGenBuffers

      public void alGenBuffers(int numBuffers, IntBuffer buffers)
      Description copied from interface: AL
      Requests a number of buffer names.
      Specified by:
      alGenBuffers in interface AL
      Parameters:
      numBuffers - the number of buffers.
      buffers - the buffer that will receive the buffer names.
    • alDeleteBuffers

      public void alDeleteBuffers(int numBuffers, IntBuffer buffers)
      Description copied from interface: AL
      Requests the deletion of a number of buffers.
      Specified by:
      alDeleteBuffers in interface AL
      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 interface AL
      Parameters:
      source - the source to stop.
    • alSourcei

      public void alSourcei(int source, int param, int value)
      Description copied from interface: AL
      Integer version of Sourcef.
      Specified by:
      alSourcei in interface AL
      Parameters:
      source - the source to modify.
      param - the parameter to modify.
      value - the parameter value.
    • alBufferData

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

      public void alSourceUnqueueBuffers(int source, int numBuffers, IntBuffer buffers)
      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 interface AL
      Parameters:
      source - the target source
      numBuffers - the names count.
      buffers - the buffer names
    • alSourceQueueBuffers

      public void alSourceQueueBuffers(int source, int numBuffers, IntBuffer buffers)
      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 interface AL
      Parameters:
      source - the target source.
      numBuffers - the names count.
      buffers - the buffer names.
    • alListener

      public void alListener(int param, FloatBuffer data)
      Description copied from interface: AL
      Pointer version of Listenerf.
      Specified by:
      alListener in interface AL
      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 interface AL
      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 interface AL
      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 interface AL
      Parameters:
      source - the source to modify.
      param - the parameter to modify.
      value1 - the first value.
      value2 - the second value.
      value3 - the third value.