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.

    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()
        samples stored as floats [-1.0f, 1.0f]
      • SamplesCount

        public int SamplesCount()
        number of samples
      • Frequency

        public int Frequency()
        frequency (e.g. 44100)
      • 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

        @Deprecated
        public static OVRAudioChannelData mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static OVRAudioChannelData callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • malloc

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

        public static OVRAudioChannelData calloc​(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
      • malloc

        public static OVRAudioChannelData.Buffer malloc​(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
      • calloc

        public static OVRAudioChannelData.Buffer calloc​(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().