Package org.lwjgl.ovr

Class OVRAudioChannelData

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class OVRAudioChannelData
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Store audio PCM data (as 32b float samples) for an audio channel.

    Note: needs to be released with _ReleaseAudioChannelData to avoid memory leak.

    Member documentation

    • Samples – samples stored as floats [-1.0f, 1.0f]
    • SamplesCount – number of samples
    • Frequency – frequency (e.g. 44100)

    Layout

    
     struct ovrAudioChannelData {
         float const * Samples;
         int SamplesCount;
         int Frequency;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • SAMPLES, SAMPLESCOUNT, FREQUENCY

        The struct member offsets.
    • Constructor Detail

      • OVRAudioChannelData

        public OVRAudioChannelData​(java.nio.ByteBuffer container)
        Creates a OVRAudioChannelData instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • Samples

        public java.nio.FloatBuffer Samples()
        Returns a FloatBuffer view of the data pointed to by the Samples field.
      • SamplesCount

        public int SamplesCount()
        Returns the value of the SamplesCount field.
      • Frequency

        public int Frequency()
        Returns the value of the Frequency field.
      • malloc

        public static OVRAudioChannelData malloc()
        Returns a new OVRAudioChannelData instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static OVRAudioChannelData calloc()
        Returns a new OVRAudioChannelData instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static OVRAudioChannelData create()
        Returns a new OVRAudioChannelData instance allocated with BufferUtils.
      • create

        public static OVRAudioChannelData create​(long address)
        Returns a new OVRAudioChannelData instance for the specified memory address.
      • createSafe

        @Nullable
        public static OVRAudioChannelData createSafe​(long address)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static OVRAudioChannelData mallocStack()
        Returns a new OVRAudioChannelData instance allocated on the thread-local MemoryStack.
      • callocStack

        public static OVRAudioChannelData callocStack()
        Returns a new OVRAudioChannelData instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static OVRAudioChannelData mallocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new OVRAudioChannelData instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static OVRAudioChannelData callocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new OVRAudioChannelData instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • mallocStack

        public static OVRAudioChannelData.Buffer mallocStack​(int capacity,
                                                             org.lwjgl.system.MemoryStack stack)
        Returns a new OVRAudioChannelData.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static OVRAudioChannelData.Buffer callocStack​(int capacity,
                                                             org.lwjgl.system.MemoryStack stack)
        Returns a new OVRAudioChannelData.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nSamples

        public static java.nio.FloatBuffer nSamples​(long struct)
        Unsafe version of Samples.
      • nSamplesCount

        public static int nSamplesCount​(long struct)
        Unsafe version of SamplesCount().
      • nFrequency

        public static int nFrequency​(long struct)
        Unsafe version of Frequency().