public class AudioBuffer extends AudioData
AudioBuffer
is an implementation of AudioData
where the audio is buffered (stored in memory). All parts of it
are accessible at any time. AudioData.DataType
Modifier and Type | Field and Description |
---|---|
protected java.nio.ByteBuffer |
audioData
The audio data buffer.
|
bitsPerSample, channels, sampleRate
handleRef, id, INVALID_ID, objectManager, OBJTYPE_AUDIOBUFFER, OBJTYPE_AUDIOSTREAM, OBJTYPE_BO, OBJTYPE_FILTER, OBJTYPE_FRAMEBUFFER, OBJTYPE_SHADER, OBJTYPE_SHADERSOURCE, OBJTYPE_TEXTURE, OBJTYPE_VERTEXBUFFER, updateNeeded
Modifier | Constructor and Description |
---|---|
|
AudioBuffer() |
protected |
AudioBuffer(int id) |
Modifier and Type | Method and Description |
---|---|
NativeObject |
createDestructableClone()
Creates a shallow clone of this GL Object.
|
protected void |
deleteNativeBuffers()
Deletes any associated native
buffers . |
void |
deleteObject(java.lang.Object rendererObject)
Deletes the GL object from the GPU when it is no longer used.
|
java.nio.ByteBuffer |
getData() |
AudioData.DataType |
getDataType() |
float |
getDuration() |
long |
getUniqueId()
Returns a unique ID for this NativeObject.
|
void |
resetObject()
Called when the GL context is restarted to reset all IDs.
|
java.lang.String |
toString() |
void |
updateData(java.nio.ByteBuffer data)
Update the data in the buffer with new data.
|
getBitsPerSample, getChannels, getSampleRate, setupFormat
clearUpdateNeeded, clone, dispose, getId, getWeakRef, isUpdateNeeded, setId, setUpdateNeeded
protected java.nio.ByteBuffer audioData
public AudioData.DataType getDataType()
getDataType
in class AudioData
Buffer
or Stream
.public float getDuration()
getDuration
in class AudioData
public java.lang.String toString()
toString
in class NativeObject
public void updateData(java.nio.ByteBuffer data)
data
- java.lang.IllegalArgumentException
- if the provided buffer is not a direct bufferpublic java.nio.ByteBuffer getData()
public void resetObject()
NativeObject
resetObject
in class NativeObject
protected void deleteNativeBuffers()
NativeObject
buffers
.
This is necessary because it is unlikely that native buffers
will be garbage collected naturally (due to how GC works), therefore
the collection must be handled manually.
Only implementations that manage native buffers need to override
this method. Note that the behavior that occurs when a
deleted native buffer is used is not defined, therefore this
method is protecteddeleteNativeBuffers
in class NativeObject
public void deleteObject(java.lang.Object rendererObject)
NativeObject
deleteObject
in class NativeObject
rendererObject
- The renderer to be used to delete the objectpublic NativeObject createDestructableClone()
NativeObject
createDestructableClone
in class NativeObject
public long getUniqueId()
NativeObject
getUniqueId
in class NativeObject