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, sampleRatehandleRef, 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, setupFormatclearUpdateNeeded, clone, dispose, getId, getWeakRef, isUpdateNeeded, setId, setUpdateNeededprotected java.nio.ByteBuffer audioData
public AudioData.DataType getDataType()
getDataType in class AudioDataBuffer or Stream.public float getDuration()
getDuration in class AudioDatapublic java.lang.String toString()
toString in class NativeObjectpublic void updateData(java.nio.ByteBuffer data)
data - the audio data provided (not null, direct, alias created)java.lang.IllegalArgumentException - if the provided buffer is not a direct bufferpublic java.nio.ByteBuffer getData()
public void resetObject()
NativeObjectresetObject in class NativeObjectprotected void deleteNativeBuffers()
NativeObjectbuffers.
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 NativeObjectpublic void deleteObject(java.lang.Object rendererObject)
NativeObjectdeleteObject in class NativeObjectrendererObject - The renderer to be used to delete the objectpublic NativeObject createDestructableClone()
NativeObjectcreateDestructableClone in class NativeObjectpublic long getUniqueId()
NativeObjectgetUniqueId in class NativeObject