Package org.lwjgl.ovr
Class OVRAudioChannelData
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.ovr.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.NativeResourceStore audio PCM data (as 32b float samples) for an audio channel.Note: needs to be released with
_ReleaseAudioChannelDatato avoid memory leak.Member documentation
Samples– samples stored as floats[-1.0f, 1.0f]SamplesCount– number of samplesFrequency– frequency (e.g. 44100)
Layout
struct ovrAudioChannelData { float const * Samples; int SamplesCount; int Frequency; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOVRAudioChannelData.BufferAn array ofOVRAudioChannelDatastructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intFREQUENCY
SAMPLES
SAMPLESCOUNTThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description OVRAudioChannelData(java.nio.ByteBuffer container)Creates aOVRAudioChannelDatainstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OVRAudioChannelDatacalloc()Returns a newOVRAudioChannelDatainstance allocated withmemCalloc.static OVRAudioChannelData.Buffercalloc(int capacity)Returns a newOVRAudioChannelData.Bufferinstance allocated withmemCalloc.static OVRAudioChannelDatacallocStack()Returns a newOVRAudioChannelDatainstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRAudioChannelData.BuffercallocStack(int capacity)Returns a newOVRAudioChannelData.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRAudioChannelData.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRAudioChannelData.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRAudioChannelDatacallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRAudioChannelDatainstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRAudioChannelDatacreate()Returns a newOVRAudioChannelDatainstance allocated withBufferUtils.static OVRAudioChannelData.Buffercreate(int capacity)Returns a newOVRAudioChannelData.Bufferinstance allocated withBufferUtils.static OVRAudioChannelDatacreate(long address)Returns a newOVRAudioChannelDatainstance for the specified memory address.static OVRAudioChannelData.Buffercreate(long address, int capacity)Create aOVRAudioChannelData.Bufferinstance at the specified memory.static OVRAudioChannelDatacreateSafe(long address)static OVRAudioChannelData.BuffercreateSafe(long address, int capacity)intFrequency()Returns the value of theFrequencyfield.static OVRAudioChannelDatamalloc()Returns a newOVRAudioChannelDatainstance allocated withmemAlloc.static OVRAudioChannelData.Buffermalloc(int capacity)Returns a newOVRAudioChannelData.Bufferinstance allocated withmemAlloc.static OVRAudioChannelDatamallocStack()Returns a newOVRAudioChannelDatainstance allocated on the thread-localMemoryStack.static OVRAudioChannelData.BuffermallocStack(int capacity)Returns a newOVRAudioChannelData.Bufferinstance allocated on the thread-localMemoryStack.static OVRAudioChannelData.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRAudioChannelData.Bufferinstance allocated on the specifiedMemoryStack.static OVRAudioChannelDatamallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRAudioChannelDatainstance allocated on the specifiedMemoryStack.static intnFrequency(long struct)Unsafe version ofFrequency().static java.nio.FloatBuffernSamples(long struct)Unsafe version ofSamples.static intnSamplesCount(long struct)Unsafe version ofSamplesCount().java.nio.FloatBufferSamples()Returns aFloatBufferview of the data pointed to by theSamplesfield.intSamplesCount()Returns the value of theSamplesCountfield.intsizeof()
-
-
-
Constructor Detail
-
OVRAudioChannelData
public OVRAudioChannelData(java.nio.ByteBuffer container)
Creates aOVRAudioChannelDatainstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
Samples
public java.nio.FloatBuffer Samples()
Returns aFloatBufferview of the data pointed to by theSamplesfield.
-
SamplesCount
public int SamplesCount()
Returns the value of theSamplesCountfield.
-
Frequency
public int Frequency()
Returns the value of theFrequencyfield.
-
malloc
public static OVRAudioChannelData malloc()
Returns a newOVRAudioChannelDatainstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static OVRAudioChannelData calloc()
Returns a newOVRAudioChannelDatainstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static OVRAudioChannelData create()
Returns a newOVRAudioChannelDatainstance allocated withBufferUtils.
-
create
public static OVRAudioChannelData create(long address)
Returns a newOVRAudioChannelDatainstance for the specified memory address.
-
createSafe
@Nullable public static OVRAudioChannelData createSafe(long address)
-
malloc
public static OVRAudioChannelData.Buffer malloc(int capacity)
Returns a newOVRAudioChannelData.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static OVRAudioChannelData.Buffer calloc(int capacity)
Returns a newOVRAudioChannelData.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static OVRAudioChannelData.Buffer create(int capacity)
Returns a newOVRAudioChannelData.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static OVRAudioChannelData.Buffer create(long address, int capacity)
Create aOVRAudioChannelData.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static OVRAudioChannelData.Buffer createSafe(long address, int capacity)
-
mallocStack
public static OVRAudioChannelData mallocStack()
Returns a newOVRAudioChannelDatainstance allocated on the thread-localMemoryStack.
-
callocStack
public static OVRAudioChannelData callocStack()
Returns a newOVRAudioChannelDatainstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static OVRAudioChannelData mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelDatainstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static OVRAudioChannelData callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelDatainstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static OVRAudioChannelData.Buffer mallocStack(int capacity)
Returns a newOVRAudioChannelData.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static OVRAudioChannelData.Buffer callocStack(int capacity)
Returns a newOVRAudioChannelData.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static OVRAudioChannelData.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelData.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static OVRAudioChannelData.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelData.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nSamples
public static java.nio.FloatBuffer nSamples(long struct)
Unsafe version ofSamples.
-
nSamplesCount
public static int nSamplesCount(long struct)
Unsafe version ofSamplesCount().
-
nFrequency
public static int nFrequency(long struct)
Unsafe version ofFrequency().
-
-