|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.util.NativeObject
com.jme3.audio.AudioData
com.jme3.audio.AudioStream
public class AudioStream
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jme3.audio.AudioData |
---|
AudioData.DataType |
Field Summary | |
---|---|
protected float |
duration
|
protected int[] |
ids
|
protected java.io.InputStream |
in
|
protected boolean |
open
|
Fields inherited from class com.jme3.audio.AudioData |
---|
bitsPerSample, channels, sampleRate |
Fields inherited from class com.jme3.util.NativeObject |
---|
handleRef, id, type, updateNeeded |
Constructor Summary | |
---|---|
|
AudioStream()
|
protected |
AudioStream(int[] ids)
|
Method Summary | |
---|---|
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()
|
void |
initIds(int count)
|
boolean |
isOpen()
|
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 GLObject. |
void |
setId(int index,
int id)
|
void |
setIds(int[] ids)
|
void |
setTime(float time)
|
void |
updateData(java.io.InputStream in,
float duration)
|
Methods inherited from class com.jme3.audio.AudioData |
---|
getBitsPerSample, getChannels, getSampleRate, setupFormat |
Methods inherited from class com.jme3.util.NativeObject |
---|
clearUpdateNeeded, clone, isUpdateNeeded, setUpdateNeeded, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.io.InputStream in
protected float duration
protected boolean open
protected int[] ids
Constructor Detail |
---|
public AudioStream()
protected AudioStream(int[] ids)
Method Detail |
---|
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 samples
public int readSamples(byte[] buf)
buf
- Buffer where to read the samples
readSamples(byte[], int, int)
public float getDuration()
getDuration
in class AudioData
public int getId()
getId
in class NativeObject
public void setId(int id)
NativeObject
setId
in class NativeObject
id
- 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 AudioData
Buffer
or Stream
.public void resetObject()
NativeObject
resetObject
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 boolean isOpen()
public void close()
close
in interface java.io.Closeable
java.io.IOException
public void setTime(float time)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |