public class AudioStream extends AudioData implements java.io.Closeable
AudioStream is an implementation of AudioData that acquires the
audio from an InputStream. Audio can be streamed from network, hard drive
etc. It is assumed the data coming from the input stream is uncompressed.AudioData.DataType| Modifier and Type | Field and Description |
|---|---|
protected float |
duration |
protected boolean |
eof |
protected int[] |
ids |
protected java.io.InputStream |
in |
protected boolean |
open |
protected int |
unqueuedBuffersBytes |
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 |
|---|---|
|
AudioStream() |
protected |
AudioStream(int[] ids) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the stream, releasing all data relating to it.
|
NativeObject |
createDestructableClone()
Creates a shallow clone of this GL Object.
|
void |
deleteObject(java.lang.Object rendererObject)
Deletes the GL object from the GPU when it is no longer used.
|
AudioData.DataType |
getDataType() |
float |
getDuration() |
int |
getId() |
int |
getId(int index) |
int[] |
getIds() |
long |
getUniqueId()
Returns a unique ID for this NativeObject.
|
int |
getUnqueuedBufferBytes() |
void |
initIds(int count) |
boolean |
isEOF() |
boolean |
isSeekable() |
int |
readSamples(byte[] buf)
Reads samples from the stream.
|
int |
readSamples(byte[] buf,
int offset,
int length)
Reads samples from the stream.
|
void |
resetObject()
Called when the GL context is restarted to reset all IDs.
|
void |
setId(int id)
Sets the ID of the NativeObject.
|
void |
setId(int index,
int id) |
void |
setIds(int[] ids) |
void |
setTime(float time) |
void |
setUnqueuedBufferBytes(int unqueuedBuffers) |
void |
updateData(java.io.InputStream in,
float duration) |
getBitsPerSample, getChannels, getSampleRate, setupFormatclearUpdateNeeded, clone, deleteNativeBuffers, dispose, isUpdateNeeded, setUpdateNeeded, toStringprotected java.io.InputStream in
protected float duration
protected boolean open
protected boolean eof
protected int[] ids
protected int unqueuedBuffersBytes
public void updateData(java.io.InputStream in,
float duration)
public int readSamples(byte[] buf,
int offset,
int length)
buf - Buffer where to read the samplesoffset - The offset in the buffer where to read sampleslength - The length inside the buffer where to read samplespublic int readSamples(byte[] buf)
buf - Buffer where to read the samplesreadSamples(byte[], int, int)public float getDuration()
getDuration in class AudioDatapublic int getId()
getId in class NativeObjectpublic void setId(int id)
NativeObjectsetId in class NativeObjectid - The ID to setpublic void initIds(int count)
public int getId(int index)
public void setId(int index,
int id)
public int[] getIds()
public void setIds(int[] ids)
public AudioData.DataType getDataType()
getDataType in class AudioDataBuffer or Stream.public void resetObject()
NativeObjectresetObject 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 boolean isEOF()
public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionpublic boolean isSeekable()
public int getUnqueuedBufferBytes()
public void setUnqueuedBufferBytes(int unqueuedBuffers)
public void setTime(float time)
public long getUniqueId()
NativeObjectgetUniqueId in class NativeObject