|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.geom.Vec3D
toxi.audio.AudioSource
public class AudioSource
A wrapper for AudioBuffer
s and similar to the built in JOAL
net.java.games.sound3d.Source, though less restrictive. The class extends
Vec3D
and so can be used to position the sound in 3D space (provided
the underlying audio hardware does support 3D audio). Unfortunately due to
OpenAL's limitations only mono samples can be positioned in that way. Stereo
samples will can only manipulated in terms of gain/volume.
If the position of an AudioSource is changed via the public x,y,z vector
components, the updatePosition()
method needs to be called
afterwards in order to reflect the changes in the OpenAL context.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class toxi.geom.Vec3D |
---|
toxi.geom.Vec3D.Axis |
Field Summary |
---|
Fields inherited from class toxi.geom.Vec3D |
---|
MAX_VALUE, MIN_VALUE, x, X_AXIS, y, Y_AXIS, z, Z_AXIS, ZERO |
Constructor Summary | |
---|---|
AudioSource(net.java.games.joal.AL al,
int id)
|
|
AudioSource(net.java.games.joal.AL al,
int id,
AudioBuffer buf)
|
Method Summary | |
---|---|
boolean |
delete()
Deletes this source, and free its resources. |
AudioBuffer |
getBuffer()
Gets the buffer associated with this source. |
int |
getBuffersProcessed()
Gets the number of buffers already processed on this source. |
float[] |
getDirection()
|
int |
getID()
|
int |
getOffset()
|
float[] |
getPosition()
|
float[] |
getVelocity()
|
boolean |
isLooping()
|
int |
length()
|
AudioSource |
play()
|
AudioSource |
rewind()
|
AudioSource |
setBuffer(AudioBuffer buffer)
Sets the buffer associated with this source. |
AudioSource |
setDirection(float[] d)
|
AudioSource |
setDirection(float xx,
float yy,
float zz)
|
AudioSource |
setDirection(toxi.geom.Vec3D dir)
|
AudioSource |
setGain(float gain)
|
AudioSource |
setLooping(boolean state)
|
AudioSource |
setOffset(int off)
|
AudioSource |
setPitch(float pitch)
|
AudioSource |
setPosition(float[] p)
|
AudioSource |
setPosition(float xx,
float yy,
float zz)
|
AudioSource |
setPosition(toxi.geom.Vec3D p)
|
AudioSource |
setReferenceDistance(float d)
|
AudioSource |
setVelocity(float[] v)
|
AudioSource |
setVelocity(float xx,
float yy,
float zz)
|
AudioSource |
setVelocity(toxi.geom.Vec3D p)
|
AudioSource |
stop()
|
java.lang.String |
toString()
|
AudioSource |
updatePosition()
|
Methods inherited from class toxi.geom.Vec3D |
---|
abs, add, add, add, addSelf, addSelf, angleBetween, angleBetween, clear, compareTo, constrain, constrain, copy, cross, cross, crossInto, crossSelf, distanceTo, distanceToSquared, dot, dot, equals, equalsWithTolerance, floor, frac, fromXYTheta, fromXZTheta, fromYZTheta, getAbs, getComponent, getComponent, getConstrained, getFloored, getFrac, getInverted, getLimited, getNormalized, getNormalizedTo, getReciprocal, getReflected, getRotatedAroundAxis, getRotatedX, getRotatedY, getRotatedZ, getSignum, hashCode, headingXY, headingXZ, headingYZ, immutable, interpolateTo, interpolateTo, interpolateTo, interpolateTo, interpolateToSelf, interpolateToSelf, invert, isInAABB, isInAABB, isMajorAxis, isZeroVector, jitter, jitter, jitter, jitter, jitter, jitter, limit, magnitude, magSquared, max, maxSelf, min, minSelf, modSelf, modSelf, normalize, normalizeTo, randomVector, randomVector, reciprocal, reflect, rotateAroundAxis, rotateX, rotateY, rotateZ, roundToAxis, scale, scale, scale, scale, scaleSelf, scaleSelf, scaleSelf, set, set, set, setComponent, setComponent, setXY, shuffle, signum, sub, sub, sub, subSelf, subSelf, to2DXY, to2DXZ, to2DYZ, toArray, toArray4, toCartesian, toSpherical, x, y, z |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AudioSource(net.java.games.joal.AL al, int id)
public AudioSource(net.java.games.joal.AL al, int id, AudioBuffer buf)
Method Detail |
---|
public boolean delete()
JOALUtil.deleteSource(AudioSource, boolean)
instead.
public AudioBuffer getBuffer()
public int getBuffersProcessed()
public final float[] getDirection()
public final int getID()
public final int getOffset()
public final float[] getPosition()
public final float[] getVelocity()
public final boolean isLooping()
public final int length()
public AudioSource play()
public AudioSource rewind()
public AudioSource setBuffer(AudioBuffer buffer)
buffer
- the buffer associated with this sourcepublic AudioSource setDirection(float xx, float yy, float zz)
public AudioSource setDirection(float[] d)
public AudioSource setDirection(toxi.geom.Vec3D dir)
public AudioSource setGain(float gain)
public AudioSource setLooping(boolean state)
public AudioSource setOffset(int off)
public AudioSource setPitch(float pitch)
public AudioSource setPosition(float xx, float yy, float zz)
public AudioSource setPosition(float[] p)
public AudioSource setPosition(toxi.geom.Vec3D p)
public AudioSource setReferenceDistance(float d)
public AudioSource setVelocity(float xx, float yy, float zz)
public AudioSource setVelocity(float[] v)
public AudioSource setVelocity(toxi.geom.Vec3D p)
public AudioSource stop()
public java.lang.String toString()
toString
in class toxi.geom.Vec3D
public AudioSource updatePosition()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |