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.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 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 class
OVRAudioChannelData.Buffer
An array ofOVRAudioChannelData
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
FREQUENCY
SAMPLES
SAMPLESCOUNTThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description OVRAudioChannelData(java.nio.ByteBuffer container)
Creates aOVRAudioChannelData
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OVRAudioChannelData
calloc()
Returns a newOVRAudioChannelData
instance allocated withmemCalloc
.static OVRAudioChannelData.Buffer
calloc(int capacity)
Returns a newOVRAudioChannelData.Buffer
instance allocated withmemCalloc
.static OVRAudioChannelData
callocStack()
Returns a newOVRAudioChannelData
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRAudioChannelData.Buffer
callocStack(int capacity)
Returns a newOVRAudioChannelData.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRAudioChannelData.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelData.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRAudioChannelData
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelData
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRAudioChannelData
create()
Returns a newOVRAudioChannelData
instance allocated withBufferUtils
.static OVRAudioChannelData.Buffer
create(int capacity)
Returns a newOVRAudioChannelData.Buffer
instance allocated withBufferUtils
.static OVRAudioChannelData
create(long address)
Returns a newOVRAudioChannelData
instance for the specified memory address.static OVRAudioChannelData.Buffer
create(long address, int capacity)
Create aOVRAudioChannelData.Buffer
instance at the specified memory.static OVRAudioChannelData
createSafe(long address)
static OVRAudioChannelData.Buffer
createSafe(long address, int capacity)
int
Frequency()
Returns the value of theFrequency
field.static OVRAudioChannelData
malloc()
Returns a newOVRAudioChannelData
instance allocated withmemAlloc
.static OVRAudioChannelData.Buffer
malloc(int capacity)
Returns a newOVRAudioChannelData.Buffer
instance allocated withmemAlloc
.static OVRAudioChannelData
mallocStack()
Returns a newOVRAudioChannelData
instance allocated on the thread-localMemoryStack
.static OVRAudioChannelData.Buffer
mallocStack(int capacity)
Returns a newOVRAudioChannelData.Buffer
instance allocated on the thread-localMemoryStack
.static OVRAudioChannelData.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelData.Buffer
instance allocated on the specifiedMemoryStack
.static OVRAudioChannelData
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelData
instance allocated on the specifiedMemoryStack
.static int
nFrequency(long struct)
Unsafe version ofFrequency()
.static java.nio.FloatBuffer
nSamples(long struct)
Unsafe version ofSamples
.static int
nSamplesCount(long struct)
Unsafe version ofSamplesCount()
.java.nio.FloatBuffer
Samples()
Returns aFloatBuffer
view of the data pointed to by theSamples
field.int
SamplesCount()
Returns the value of theSamplesCount
field.int
sizeof()
-
-
-
Constructor Detail
-
OVRAudioChannelData
public OVRAudioChannelData(java.nio.ByteBuffer container)
Creates aOVRAudioChannelData
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
Samples
public java.nio.FloatBuffer Samples()
Returns aFloatBuffer
view of the data pointed to by theSamples
field.
-
SamplesCount
public int SamplesCount()
Returns the value of theSamplesCount
field.
-
Frequency
public int Frequency()
Returns the value of theFrequency
field.
-
malloc
public static OVRAudioChannelData malloc()
Returns a newOVRAudioChannelData
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static OVRAudioChannelData calloc()
Returns a newOVRAudioChannelData
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static OVRAudioChannelData create()
Returns a newOVRAudioChannelData
instance allocated withBufferUtils
.
-
create
public static OVRAudioChannelData create(long address)
Returns a newOVRAudioChannelData
instance for the specified memory address.
-
createSafe
@Nullable public static OVRAudioChannelData createSafe(long address)
-
malloc
public static OVRAudioChannelData.Buffer malloc(int capacity)
Returns a newOVRAudioChannelData.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static OVRAudioChannelData.Buffer calloc(int capacity)
Returns a newOVRAudioChannelData.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRAudioChannelData.Buffer create(int capacity)
Returns a newOVRAudioChannelData.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRAudioChannelData.Buffer create(long address, int capacity)
Create aOVRAudioChannelData.Buffer
instance 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 newOVRAudioChannelData
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static OVRAudioChannelData callocStack()
Returns a newOVRAudioChannelData
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static OVRAudioChannelData mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelData
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRAudioChannelData callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRAudioChannelData
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static OVRAudioChannelData.Buffer callocStack(int capacity)
Returns a newOVRAudioChannelData.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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()
.
-
-