com.jme3.audio
クラス AudioStream
java.lang.Object
com.jme3.audio.ALObject
com.jme3.audio.AudioData
com.jme3.audio.AudioStream
- すべての実装されたインタフェース:
- java.io.Closeable
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.
クラス java.lang.Object から継承されたメソッド |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AudioStream
public AudioStream()
updateData
public void updateData(java.io.InputStream in,
float duration)
readSamples
public int readSamples(byte[] buf,
int offset,
int length)
- Reads samples from the stream. The format of the data
depends on the getSampleRate(), getChannels(), getBitsPerSample()
values.
- パラメータ:
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
- 戻り値:
- number of bytes read.
readSamples
public int readSamples(byte[] buf)
- Reads samples from the stream.
- パラメータ:
buf
- Buffer where to read the samples
- 戻り値:
- number of bytes read.
- 関連項目:
readSamples(byte[], int, int)
getDuration
public float getDuration()
- 定義:
- クラス
AudioData
内の getDuration
- 戻り値:
- the duration in seconds of the audio clip.
getId
public int getId()
- オーバーライド:
- クラス
ALObject
内の getId
setId
public void setId(int id)
- オーバーライド:
- クラス
ALObject
内の setId
initIds
public void initIds(int count)
getId
public int getId(int index)
setId
public void setId(int index,
int id)
getIds
public int[] getIds()
setIds
public void setIds(int[] ids)
getDataType
public AudioData.DataType getDataType()
- 定義:
- クラス
AudioData
内の getDataType
- 戻り値:
- The data type, either
Buffer
or Stream
.
resetObject
public void resetObject()
- 定義:
- クラス
ALObject
内の resetObject
deleteObject
public void deleteObject(AudioRenderer r)
- 定義:
- クラス
ALObject
内の deleteObject
isOpen
public boolean isOpen()
- 戻り値:
- Whether the stream is open or not. Reading from a closed
stream will always return eof.
close
public void close()
- Closes the stream, releasing all data relating to it. Reading
from the stream will return eof.
- 定義:
- インタフェース
java.io.Closeable
内の close
- 例外:
java.io.IOException