Class SOFTCallbackBuffer

java.lang.Object
org.lwjgl.openal.SOFTCallbackBuffer

public class SOFTCallbackBuffer extends Object
Native bindings to the SOFT_callback_buffer extension.

This extension provides a mechanism for applications to provide sample data to the audio device in real-time.

Standard OpenAL sources can read samples from a pre-loaded static buffer, or from a queue of prepared buffers that can be fed in over time. In both cases, an application needs to prepare all or some of the audio samples ahead of time to ensure proper continuous playback. A callback mechanism allows applications to generate audio as needed, without having to prepare samples ahead of time, and to implement their own streaming interface instead of having to fill, queue, and manage multiple OpenAL buffers per stream.

  • Field Details

  • Method Details

    • nalBufferCallbackSOFT

      public static void nalBufferCallbackSOFT(int buffer, int format, int freq, long callback, long userptr)
      Unsafe version of: BufferCallbackSOFT
    • alBufferCallbackSOFT

      public static void alBufferCallbackSOFT(int buffer, int format, int freq, SOFTCallbackBufferTypeI callback, long userptr)
      Instead of storing sample data, a buffer may be given a callback function which will be invoked when the source it's attached to needs more samples to mix. To specify a callback for a buffer, use alBufferCallbackSOFT.

      After a successful call, any sample data that was stored in the buffer is removed.

      A buffer with a callback cannot be queued onto a streaming source, and it can only be set on one static source at a time. Attempting to queue such a buffer on a source, or attempting to set it on a source while it's already on one, will generate an INVALID_OPERATION error.

      A subsequent successful call to BufferData will remove the callback from the buffer, and make it a normal non-callback buffer.

      Parameters:
      format - the sample format that will be expected from the callback
      freq - the base sample rate the samples will play at
      userptr - stored with the callback pointer. Any data it references is not copied
    • nalGetBufferPtrSOFT

      public static void nalGetBufferPtrSOFT(int buffer, int param, long ptr)
    • alGetBufferPtrSOFT

      public static void alGetBufferPtrSOFT(int buffer, int param, org.lwjgl.PointerBuffer ptr)
    • alGetBufferPtrSOFT

      public static long alGetBufferPtrSOFT(int buffer, int param)
    • nalGetBuffer3PtrSOFT

      public static void nalGetBuffer3PtrSOFT(int buffer, int param, long ptr0, long ptr1, long ptr2)
    • alGetBuffer3PtrSOFT

      public static void alGetBuffer3PtrSOFT(int buffer, int param, org.lwjgl.PointerBuffer ptr0, org.lwjgl.PointerBuffer ptr1, org.lwjgl.PointerBuffer ptr2)
    • nalGetBufferPtrvSOFT

      public static void nalGetBufferPtrvSOFT(int buffer, int param, long ptr)
    • alGetBufferPtrvSOFT

      public static void alGetBufferPtrvSOFT(int buffer, int param, org.lwjgl.PointerBuffer ptr)