Top Description Fields Constructors Methods
com.jogamp.openal.sound3d

public final Class Source

extends Object
Class Inheritance
Imports
com.jogamp.openal.AL, .ALConstants

This class is used to represent sound-producing objects in the Sound3D environment. It contains methods for setting the position, direction, pitch, gain and other properties along with methods for starting, pausing, rewinding and stopping sudio projecting from a source.
Author
Athomas Goldberg

Field Summary

Modifier and TypeField and Description
private final AL
private Buffer
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
Source(final AL al, final int sourceID)

Method Summary

Modifier and TypeMethod and Description
public void
delete()

Delete this source, freeing its resources.

public Buffer

Returns:

the buffer associated with this source
getBuffer
()

Gets the buffer associated with this source.

public int

Returns:

the number of buffers already processed on this source.
getBuffersProcessed
()

Gets the number of buffers already processed on this source.

public int

Returns:

the number of buffers currently queued on this source.
getBuffersQueued
()

Gets the number of buffers currently queued on this source.

public float

Returns:

the gain when outside the oriented cone.
getConeOuterGain
()

Gets the gain when outside the oriented cone.

public Vec3f

Returns:

the direction vector of the source.
getDirection
()

Gets the direction vector of the source.

public float

Returns:

the gain of the audio on this source
getGain
()

Gets the gain of the audio on this source.

public boolean

Returns:

true-looping is on, false-looping is off
getLooping
()

indicates whether looping is turned on or off.

public float

Returns:

the max ditance for source attentuation.
getMaxDistance
()

Gets the max distance where there will no longer be any attenuation of the source.

public float

Returns:

the maximum gain for this source
getMaxGain
()

SGets the maximum gain for this source.

public float

Returns:

the minimum gain for this source.
getMinGain
()

Gets the minimum gain for this source.

public float

Returns:

the pitch value of this source.
getPitch
()

Gets the pitch of the audio on this source.

public Vec3f

Returns:

a Vec3f object containing the x,y,z position of the source.
getPosition
()

Gets the x,y,z position of the source.

public float

Returns:

the reference distance for the source.
getReferenceDistance
()

Gets the distance under which the volume for the source would normally drop by half, before being influenced by rolloff factor or max distance.

public float

Returns:

the rolloff rate of the source.
getRolloffFactor
()

Gets the rolloff rate of the source.

public Vec3f

Returns:

the velocity vector of the source
getVelocity
()

Gets the velocity vector of the source.

public boolean

Returns:

true if this source is playing.
isPlaying
()

Determines whether or not this source is playing.

public boolean

Returns:

true if the position of the source is relative to the listener, false if the position of the source is relative to the world.
isSourceRelative
()

Determines if the position of the source is relative to the listener.

public void
pause()

pauses the audio in this Source.

public void
play()

Beginning playing the audio in this source.

public void
queueBuffers(final Buffer[]
a set of initialized (loaded) buffers.
buffers
)

Queues one or more buffers on a source.

public void
rewind()

Rewinds the audio in this source

public void
setBuffer(final Buffer
the buffer associated with this source
buffer
)

Sets the buffer associated with this source.

public void
setConeOuterGain(final float
the gain when outside the oriented cone.
coneOuterGain
)

Sets the gain when outside the oriented cone.

public void
setDirection(final Vec3f
the direction vector of the source.
direction
)

Sets the direction vector of the source.

public void
setDirection(final float
the x direction of the source.
x
,
final float
the y direction of the source.
y
,
final float
the z direction of the source.
z
)

Sets the direction vector of the source.

public void
setGain(final float
the gain of the audio on this source
gain
)

Sets the gain of the audio on this source.

public void
setLooping(final boolean
true-looping is on, false-looping is off
isLooping
)

turns looping on or off.

public void
setMaxDistance(final float
the max ditance for source attentuation.
maxDistance
)

Sets the max distance where there will no longer be any attenuation of the source.

public void
setMaxGain(final float
the maximum gain for this source
maxGain
)

Sets the maximum gain for this source.

public void
setMinGain(final float
the minimum gain for this source.
minGain
)

Sets the minimum gain for this source.

public void
setPitch(final float
the pitch value of this source.
pitch
)

Sets the pitch of the audio on this source.

public void
setPosition(final Vec3f
a Vec3f object containing the x,y,z position of the source.
position
)

Sets the x,y,z position of the source.

public void
setPosition(final float
the x position of the source.
x
,
final float
the y position of the source.
y
,
final float
the z position of the source.
z
)

Sets the x,y,z position of the source.

public void
setReferenceDistance(final float
the reference distance for the source.
referenceDistance
)

Sets the distance under which the volume for the source would normally drop by half, before being influenced by rolloff factor or max distance.

public void
setRolloffFactor(final float
the rolloff rate of the source.
rolloffFactor
)

Sets the rolloff rate of the source.

public void
setSourceRelative(final boolean
true if the position of the source is relative to the listener, false if the position of the source is relative to the world.
isRelative
)

Determines if the position of the source is relative to the listener.

public void
setVelocity(final Vec3f
the velocity vector of the source
velocity
)

Sets the velocity vector of the source.

public void
setVelocity(final float
the x velocity of the source.
x
,
final float
the y velocity of the source.
y
,
final float
the z velocity of the source.
z
)

Sets the velocity vector of the source.

public void
stop()

Stops the audio in this Source

public void
unqueueBuffers(final Buffer[]
a set of previously queued buffers.
buffers
)

Unqueues one or more buffers on a source.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

alback to summary
private final AL al
bufferback to summary
private Buffer buffer
sourceIDback to summary
private final int sourceID

Constructor Detail

Sourceback to summary
pack-priv Source(final AL al, final int sourceID)

Method Detail

deleteback to summary
public void delete()

Delete this source, freeing its resources.

getBufferback to summary
public Buffer getBuffer()

Gets the buffer associated with this source.

Returns:Buffer

the buffer associated with this source

getBuffersProcessedback to summary
public int getBuffersProcessed()

Gets the number of buffers already processed on this source.

Returns:int

the number of buffers already processed on this source.

getBuffersQueuedback to summary
public int getBuffersQueued()

Gets the number of buffers currently queued on this source.

Returns:int

the number of buffers currently queued on this source.

getConeOuterGainback to summary
public float getConeOuterGain()

Gets the gain when outside the oriented cone.

Returns:float

the gain when outside the oriented cone.

getDirectionback to summary
public Vec3f getDirection()

Gets the direction vector of the source.

Returns:Vec3f

the direction vector of the source.

getGainback to summary
public float getGain()

Gets the gain of the audio on this source. This can be used to contro the volume of the source.

Returns:float

the gain of the audio on this source

getLoopingback to summary
public boolean getLooping()

indicates whether looping is turned on or off.

Returns:boolean

true-looping is on, false-looping is off

getMaxDistanceback to summary
public float getMaxDistance()

Gets the max distance where there will no longer be any attenuation of the source.

Returns:float

the max ditance for source attentuation.

getMaxGainback to summary
public float getMaxGain()

SGets the maximum gain for this source.

Returns:float

the maximum gain for this source

getMinGainback to summary
public float getMinGain()

Gets the minimum gain for this source.

Returns:float

the minimum gain for this source.

getPitchback to summary
public float getPitch()

Gets the pitch of the audio on this source. The pitch may be modified without altering the playback speed of the audio.

Returns:float

the pitch value of this source.

getPositionback to summary
public Vec3f getPosition()

Gets the x,y,z position of the source.

Returns:Vec3f

a Vec3f object containing the x,y,z position of the source.

getReferenceDistanceback to summary
public float getReferenceDistance()

Gets the distance under which the volume for the source would normally drop by half, before being influenced by rolloff factor or max distance.

Returns:float

the reference distance for the source.

getRolloffFactorback to summary
public float getRolloffFactor()

Gets the rolloff rate of the source. The default value is 1.0

Returns:float

the rolloff rate of the source.

getVelocityback to summary
public Vec3f getVelocity()

Gets the velocity vector of the source.

Returns:Vec3f

the velocity vector of the source

isPlayingback to summary
public boolean isPlaying()

Determines whether or not this source is playing.

Returns:boolean

true if this source is playing.

isSourceRelativeback to summary
public boolean isSourceRelative()

Determines if the position of the source is relative to the listener. The default is false.

Returns:boolean

true if the position of the source is relative to the listener, false if the position of the source is relative to the world.

pauseback to summary
public void pause()

pauses the audio in this Source.

playback to summary
public void play()

Beginning playing the audio in this source.

queueBuffersback to summary
public void queueBuffers(final Buffer[] buffers)

Queues one or more buffers on a source. Useful for streaming audio, buffers will be played in the order they are queued.

Parameters
buffers:Buffer[]

a set of initialized (loaded) buffers.

rewindback to summary
public void rewind()

Rewinds the audio in this source

setBufferback to summary
public void setBuffer(final Buffer buffer)

Sets the buffer associated with this source.

Parameters
buffer:Buffer

the buffer associated with this source

setConeOuterGainback to summary
public void setConeOuterGain(final float coneOuterGain)

Sets the gain when outside the oriented cone.

Parameters
coneOuterGain:float

the gain when outside the oriented cone.

setDirectionback to summary
public void setDirection(final Vec3f direction)

Sets the direction vector of the source.

Parameters
direction:Vec3f

the direction vector of the source.

setDirectionback to summary
public void setDirection(final float x, final float y, final float z)

Sets the direction vector of the source.

Parameters
x:float

the x direction of the source.

y:float

the y direction of the source.

z:float

the z direction of the source.

setGainback to summary
public void setGain(final float gain)

Sets the gain of the audio on this source. This can be used to contro the volume of the source.

Parameters
gain:float

the gain of the audio on this source

setLoopingback to summary
public void setLooping(final boolean isLooping)

turns looping on or off.

Parameters
isLooping:boolean

true-looping is on, false-looping is off

setMaxDistanceback to summary
public void setMaxDistance(final float maxDistance)

Sets the max distance where there will no longer be any attenuation of the source.

Parameters
maxDistance:float

the max ditance for source attentuation.

setMaxGainback to summary
public void setMaxGain(final float maxGain)

Sets the maximum gain for this source.

Parameters
maxGain:float

the maximum gain for this source

setMinGainback to summary
public void setMinGain(final float minGain)

Sets the minimum gain for this source.

Parameters
minGain:float

the minimum gain for this source.

setPitchback to summary
public void setPitch(final float pitch)

Sets the pitch of the audio on this source. The pitch may be modified without altering the playback speed of the audio.

Parameters
pitch:float

the pitch value of this source.

setPositionback to summary
public void setPosition(final Vec3f position)

Sets the x,y,z position of the source.

Parameters
position:Vec3f

a Vec3f object containing the x,y,z position of the source.

setPositionback to summary
public void setPosition(final float x, final float y, final float z)

Sets the x,y,z position of the source.

Parameters
x:float

the x position of the source.

y:float

the y position of the source.

z:float

the z position of the source.

setReferenceDistanceback to summary
public void setReferenceDistance(final float referenceDistance)

Sets the distance under which the volume for the source would normally drop by half, before being influenced by rolloff factor or max distance.

Parameters
referenceDistance:float

the reference distance for the source.

setRolloffFactorback to summary
public void setRolloffFactor(final float rolloffFactor)

Sets the rolloff rate of the source. The default value is 1.0

Parameters
rolloffFactor:float

the rolloff rate of the source.

setSourceRelativeback to summary
public void setSourceRelative(final boolean isRelative)

Determines if the position of the source is relative to the listener. The default is false.

Parameters
isRelative:boolean

true if the position of the source is relative to the listener, false if the position of the source is relative to the world.

setVelocityback to summary
public void setVelocity(final Vec3f velocity)

Sets the velocity vector of the source.

Parameters
velocity:Vec3f

the velocity vector of the source

setVelocityback to summary
public void setVelocity(final float x, final float y, final float z)

Sets the velocity vector of the source.

Parameters
x:float

the x velocity of the source.

y:float

the y velocity of the source.

z:float

the z velocity of the source.

stopback to summary
public void stop()

Stops the audio in this Source

unqueueBuffersback to summary
public void unqueueBuffers(final Buffer[] buffers)

Unqueues one or more buffers on a source.

Parameters
buffers:Buffer[]

a set of previously queued buffers.