public class AudioSource extends NativeObject
| Modifier and Type | Field and Description |
|---|---|
protected AudioBuffer |
buffer
Associated
AudioBuffer |
protected float |
gain
Gain of this AudioSource. 0.0f is minimum and 1.0f maximum.
|
protected boolean |
loop
Indicates whether this AudioSource should be played in a loop.
|
protected Vector3f |
position
Position of this AudioSource in 3D space.
|
protected boolean |
relative
If this AudioSource is not relative,
getPosition() will be interpreted
as absolute world coordiantes, otherwise as offset from the
AudioListener. |
protected AudioSourceState |
state
Stores the current state of this AudioSource.
|
protected Vector3f |
velocity
The velocity of the AudioSource, for doppler effects etc.
|
INVALID_ID| Constructor and Description |
|---|
AudioSource(AudioBuffer buffer) |
AudioSource(AudioBuffer buffer,
Vector3f position,
Vector3f velocity) |
AudioSource(AudioBuffer buffer,
Vector3f position,
Vector3f velocity,
boolean loop,
boolean relative,
float gain,
AudioSourceState state) |
| Modifier and Type | Method and Description |
|---|---|
AudioBuffer |
getBuffer()
Associated
AudioBuffer |
float |
getGain()
Gain of this AudioSource. 0.0f is minimum and 1.0f maximum.
|
Vector3f |
getPosition()
Position of this AudioSource in 3D space.
|
AudioSourceState |
getState()
Stores the current state of this AudioSource.
|
Vector3f |
getVelocity()
The velocity of the AudioSource, for doppler effects etc.
|
boolean |
isLoop()
Indicates whether this AudioSource should be played in a loop.
|
boolean |
isRelative()
If this AudioSource is not relative,
getPosition() will be interpreted
as absolute world coordiantes, otherwise as offset from the
AudioListener. |
void |
setBuffer(AudioBuffer buffer)
Associated
AudioBuffer |
void |
setGain(float gain)
Gain of this AudioSource. 0.0f is minimum and 1.0f maximum.
|
void |
setLoop(boolean loop)
Indicates whether this AudioSource should be played in a loop.
|
void |
setPosition(Vector3f position)
Position of this AudioSource in 3D space.
|
void |
setRelative(boolean relative)
If this AudioSource is not relative,
getPosition() will be interpreted
as absolute world coordiantes, otherwise as offset from the
AudioListener. |
void |
setState(AudioSourceState playing)
internal use only.
|
void |
setVelocity(Vector3f velocity)
The velocity of the AudioSource, for doppler effects etc.
|
String |
toString() |
getID, setIDprotected AudioBuffer buffer
AudioBufferprotected Vector3f position
AudioListener.isRelative()protected Vector3f velocity
protected boolean loop
protected boolean relative
getPosition() will be interpreted
as absolute world coordiantes, otherwise as offset from the
AudioListener.protected float gain
protected AudioSourceState state
public AudioSource(AudioBuffer buffer)
public AudioSource(AudioBuffer buffer, Vector3f position, Vector3f velocity)
@ConstructorProperties(value={"buffer","position","velocity","loop","relative","gain","state"}) @Generated(value="lombok") public AudioSource(AudioBuffer buffer, Vector3f position, Vector3f velocity, boolean loop, boolean relative, float gain, AudioSourceState state)
public void setState(AudioSourceState playing)
playing - the new state@Generated(value="lombok") public AudioBuffer getBuffer()
AudioBuffer@Generated(value="lombok") public Vector3f getPosition()
AudioListener.isRelative()@Generated(value="lombok") public Vector3f getVelocity()
@Generated(value="lombok") public boolean isLoop()
@Generated(value="lombok") public boolean isRelative()
getPosition() will be interpreted
as absolute world coordiantes, otherwise as offset from the
AudioListener.@Generated(value="lombok") public float getGain()
@Generated(value="lombok") public AudioSourceState getState()
@Generated(value="lombok") public void setBuffer(AudioBuffer buffer)
AudioBufferbuffer - New buffer to use with this AudioSource@Generated(value="lombok") public void setPosition(Vector3f position)
AudioListener.position - Sets the new positionisRelative()@Generated(value="lombok") public void setVelocity(Vector3f velocity)
velocity - new velocity@Generated(value="lombok") public void setLoop(boolean loop)
loop - if it should be looped@Generated(value="lombok") public void setRelative(boolean relative)
getPosition() will be interpreted
as absolute world coordiantes, otherwise as offset from the
AudioListener.relative - if position is relative@Generated(value="lombok") public void setGain(float gain)
gain - gain of the AudioSourceCopyright © 2015. All rights reserved.