|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.jinx.audio.Source
net.jinx.audio.SynthesizedSource
public class SynthesizedSource
| Constructor Summary | |
|---|---|
SynthesizedSource(net.java.games.joal.AL al,
net.java.games.joal.ALC alc,
SampleProcessor source,
int samples,
boolean is8Bit)
Constructs a new SynthesizedSource. |
|
| Method Summary | |
|---|---|
void |
delete()
Frees the resources that this Source consumes. |
boolean |
isLooping()
Returns false, since synthesized sound CANNOT loop in a normal sense. |
void |
play()
Calls update to fill the playback buffers and then starts playback. |
void |
queueBuffer(Buffer buffer)
Does nothing. |
void |
queueBuffers(Buffer[] buffers)
Does nothing. |
void |
rewind()
Does nothing, for much the same reasons looping is unsupported. |
void |
setBuffer(Buffer buffer)
Does nothing. |
void |
setLooping(boolean loop)
Does nothing, since synthesized sound CANNOT loop in a normal sense. |
void |
stop()
Calls pause(), for now. |
void |
unqueueBuffer(Buffer buffer)
Does nothing. |
void |
unqueueBuffers(Buffer[] buffers)
Does nothing. |
void |
update()
This should be called from the associated Audible implementation to ensure that data is synthesized and sent off to be played. |
| Methods inherited from class net.jinx.audio.Source |
|---|
buffersProcessed, buffersQueued, getAL, getALC, getBooleanInt, getBuffer, getConeOuterGain, getDirection, getFloat, getGain, getInt, getMaxDistance, getMaxGain, getMinGain, getPitch, getPosition, getReferenceDistance, getRolloffFactor, getSourceID, getVelocity, isInitialized, isSourceRelative, pause, setBooleanInt, setConeOuterGain, setDirection, setDirection, setFloat, setGain, setInt, setMaxDistance, setMaxGain, setMinGain, setPitch, setPosition, setPosition, setReferenceDistance, setRolloffFactor, setSourceRelative, setVelocity, setVelocity |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SynthesizedSource(net.java.games.joal.AL al,
net.java.games.joal.ALC alc,
SampleProcessor source,
int samples,
boolean is8Bit)
al - the AL object to use for audio rendering.alc - the ALC object to use for audio rendering.source - the SampleProcessor that will be used to synthesize data.
The isSource() method for this must return true, or an
IllegalArgumentException will be thrown. This SampleProcessor must also
have a non-null SampleFormat.samples - determines how many samples should be buffered ahead
for playback of the synthesized sound. This along with the sample rate
of fmt indirectly determines the latency of the buffer (how often it is
filled. The smaller this number is, the lower the latency, but this will
cause the buffer to be filled more often, requiring more CPU time. I
reccomend a number of samples equal to 1/40 a second to a couple of
seconds, depending on your needs.is8Bit - determines if the data should be fed to JOAL as 8 or 16 bit
samples.
java.lang.NullPointerException - is thrown if any parameter is null.
java.lang.IllegalArgumentException - is thrown when one of the parameters
contains an error of some kind.| Method Detail |
|---|
public void setLooping(boolean loop)
setLooping in class Sourceloop - boolean value for setting this option.public boolean isLooping()
isLooping in class Sourcepublic void play()
play in class Sourcepublic void stop()
stop in class Sourcepublic void rewind()
rewind in class Sourcepublic void setBuffer(Buffer buffer)
setBuffer in class Sourcebuffer - the Buffer to associate with this Source.public void queueBuffers(Buffer[] buffers)
queueBuffers in class Sourcebuffers - the Buffer objects to queue.public void queueBuffer(Buffer buffer)
queueBuffer in class Sourcebuffer - the Buffer object to queue.public void unqueueBuffers(Buffer[] buffers)
unqueueBuffers in class Sourcebuffers - the Buffer objects to dequeue.public void unqueueBuffer(Buffer buffer)
unqueueBuffer in class Sourcebuffer - the Buffer object to dequeue.public void delete()
Source
delete in class Sourcepublic void update()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||