public class Source extends Object
| Constructor and Description |
|---|
Source(SoundManager soundmgr)
Creates a new source for the specified sound manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Deletes this source, rendering it unusable.
|
int |
getBuffersProcessed()
Returns the number of buffers that have been processed.
|
int |
getByteOffset()
Returns the position offset of the source within the queued buffers, in bytes.
|
int |
getId()
Returns this source's OpenAL identifier.
|
int |
getSampleOffset()
Returns the position offset of the source within the queued buffers, in samples.
|
float |
getSecOffset()
Returns the position offset of the source within the queued buffers, in seconds.
|
int |
getSourceState()
Returns the state of the source:
AL10.AL_INITIAL, AL10.AL_PLAYING,
AL10.AL_PAUSED, or AL10.AL_STOPPED. |
boolean |
isPaused()
Determines whether the source is paused.
|
boolean |
isPlaying()
Determines whether the source is playing.
|
boolean |
isStopped()
Determines whether the source is stopped.
|
void |
pause()
Pauses the source.
|
void |
play()
Starts playing the source.
|
void |
queueBuffers(Buffer... buffers)
Enqueues the specified buffers.
|
void |
rewind()
Rewinds the source.
|
void |
setBuffer(Buffer buffer)
Sets the source buffer.
|
void |
setConeInnerAngle(float angle)
Sets the inside angle of the sound cone.
|
void |
setConeOuterAngle(float angle)
Sets the outside angle of the sound cone.
|
void |
setConeOuterGain(float gain)
Sets the gain outside of the sound cone.
|
void |
setDirection(float x,
float y,
float z)
Sets the direction of the source.
|
void |
setGain(float gain)
Sets the gain of the source.
|
void |
setLooping(boolean looping)
Sets whether or not the source is looping.
|
void |
setMaxDistance(float distance)
Sets the maximum distance for attenuation.
|
void |
setMaxGain(float gain)
Sets the maximum gain.
|
void |
setMinGain(float gain)
Sets the minimum gain.
|
void |
setPitch(float pitch)
Sets the pitch multiplier.
|
void |
setPosition(float x,
float y,
float z)
Sets the position of the source.
|
void |
setReferenceDistance(float distance)
Sets the reference distance for attenuation.
|
void |
setRolloffFactor(float rolloff)
Sets the rolloff factor for attenuation.
|
void |
setSourceRelative(boolean relative)
Sets whether or not the position, velocity, etc., of the source are relative to the
listener.
|
void |
setVelocity(float x,
float y,
float z)
Sets the velocity of the source.
|
void |
stop()
Stops the source.
|
void |
unqueueBuffers(Buffer... buffers)
Removes the specified buffers from the queue.
|
public Source(SoundManager soundmgr)
public final int getId()
public void setPosition(float x,
float y,
float z)
public void setVelocity(float x,
float y,
float z)
public void setGain(float gain)
public void setSourceRelative(boolean relative)
public void setLooping(boolean looping)
public void setMinGain(float gain)
public void setMaxGain(float gain)
public void setReferenceDistance(float distance)
public void setRolloffFactor(float rolloff)
public void setMaxDistance(float distance)
public void setPitch(float pitch)
public void setDirection(float x,
float y,
float z)
public void setConeInnerAngle(float angle)
public void setConeOuterAngle(float angle)
public void setConeOuterGain(float gain)
public void setBuffer(Buffer buffer)
buffer - the buffer to set, or null to clear.public void queueBuffers(Buffer... buffers)
public void unqueueBuffers(Buffer... buffers)
public boolean isPlaying()
public boolean isPaused()
public boolean isStopped()
public int getSourceState()
AL10.AL_INITIAL, AL10.AL_PLAYING,
AL10.AL_PAUSED, or AL10.AL_STOPPED.public int getBuffersProcessed()
public float getSecOffset()
public int getSampleOffset()
public int getByteOffset()
public void play()
public void pause()
public void stop()
public void rewind()
public void delete()
Copyright © 2015. All rights reserved.