|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.audio.AbstractAudible net.jinx.audio.Buffer
public class Buffer
Buffer objects hold audio data that can be used by a Source object to play
sounds.
It is designed to loosely mimic the Buffer class of the Sound3D
toolkit, while still allowing low-level access to the OpenAL APIs.
API Stability: Alpha; this is subject to change at any time.
Constructor Summary | |
---|---|
Buffer(java.nio.ByteBuffer data,
int format,
int freq)
Constructs a new Buffer using the given data. |
Method Summary | |
---|---|
void |
deinit()
Frees the OpenAL resources that this Buffer is consuming. |
int |
getBitDepth()
Provides the bit depth of this Buffer. |
int |
getBufferID()
Provides the OpenAL name of this Buffer. |
java.nio.ByteBuffer |
getData()
Provides the ByteBuffer that contains the audio data for this Buffer. |
int |
getFormat()
Provides the format constant for this Buffer. |
int |
getFrequency()
Provides the frequency in Hertz of this Buffer. |
int |
getSize()
Utility method to get the number of bytes of audio data this Buffer holds. |
void |
init(net.java.games.joal.AL al,
net.java.games.joal.ALC alc)
Prepares this Buffer for audio rendering by generating an OpenAL buffer for it and then configuring it with this Buffer's data. |
boolean |
isStereo()
Provides a way to determine if this Buffer is mono or stereo. |
void |
update()
Does nothing. |
Methods inherited from class net.jinx.audio.AbstractAudible |
---|
getAL, getALC, isInitialized |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Buffer(java.nio.ByteBuffer data, int format, int freq)
data
- the ByteBuffer of audio data to use.format
- the OpenAL audio format constant that describes what kind
of data is in the ByteBuffer.freq
- the frequency in Hertz of the audio data (sampling rate).
java.lang.NullPointerException
- if data is null.
java.lang.IllegalArgumentException
- if fromat is invalid or freq is less
than or equal to zero.Method Detail |
---|
public int getBufferID()
public boolean isStereo()
public int getBitDepth()
public int getFrequency()
public int getFormat()
public java.nio.ByteBuffer getData()
public int getSize()
public void init(net.java.games.joal.AL al, net.java.games.joal.ALC alc)
init
in interface Audible
init
in class AbstractAudible
al
- the AL object to use for audio rendering. If this is null, a
NullPointerException will be thrown.alc
- the ALC object to use for audio rendering. If this is null, a
NullPointerException will be thrown.public void update()
public void deinit()
deinit
in interface Audible
deinit
in class AbstractAudible
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |