public class Sound extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Sound.StartObserver
Used to await notification of the starting of a sound which may be delayed in loading.
|
| Modifier and Type | Method and Description |
|---|---|
ClipBuffer |
getBuffer()
Returns the buffer of audio data associated with this sound.
|
SoundGroup |
getGroup()
Returns a reference to the group to which the sound belongs.
|
boolean |
isPending()
Called to check if this sound wants to start playing.
|
boolean |
isPlaying()
Called to check if this sound is currently playing.
|
boolean |
loop(boolean allowDefer)
Loops this sound, starting from the beginning of the audio data.
|
void |
pause()
Pauses this sound.
|
boolean |
play(boolean allowDefer)
Plays this sound from the beginning.
|
boolean |
play(Sound.StartObserver obs,
boolean loop)
Plays this sound from the beginning, notifying the supplied observer when the audio starts.
|
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 sound.
|
void |
setGain(float gain)
Sets the gain of the sound (which will be multiplied by the base gain).
|
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 sound.
|
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 sound are relative to the
listener.
|
void |
setVelocity(float x,
float y,
float z)
Sets the velocity of the sound.
|
void |
stop()
Stops this sound and rewinds to its beginning.
|
public SoundGroup getGroup()
public ClipBuffer getBuffer()
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 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 boolean play(boolean allowDefer)
allowDefer - if false, the sound will be played immediately or not at all. If true,
the sound will be queued up for loading if it is currently flushed from the cache and
played once loaded.public boolean loop(boolean allowDefer)
pause()d or stop()ped. While the sound is playing an audio channel will
be locked.public boolean play(Sound.StartObserver obs, boolean loop)
loop - whether or not to loop the sampe until stop()ped.public void pause()
play(boolean) will resume the sound from the
precise position that it left off. While the sound is paused, its audio channel will remain
locked.public void stop()
public boolean isPlaying()
public boolean isPending()
Copyright © 2015. All rights reserved.