35package com.jogamp.openal.sound3d;
37import com.jogamp.openal.ALConstants;
38import com.jogamp.openal.ALException;
62 this.sourceID = sourceID;
73 final int[] val = { -1 };
85 public int getID() {
return sourceID; }
107 }
else if(
null != buffer ) {
147 final int[] result =
new int[1];
169 final float[] result =
new float[1];
192 final float[] result =
new float[1];
215 final float[] result =
new float[1];
236 final float[] result =
new float[1];
259 final float[] result =
new float[1];
280 final float[] result =
new float[1];
301 final float[] result =
new float[1];
322 final float[] result =
new float[1];
350 public void setPosition(
final float x,
final float y,
final float z) {
362 final float[] pos =
new float[3];
364 result =
new Vec3f(pos[0], pos[1], pos[2]);
390 public void setVelocity(
final float x,
final float y,
final float z) {
401 final float[] vel =
new float[3];
403 result =
new Vec3f(vel[0], vel[1], vel[2]);
429 public void setDirection(
final float x,
final float y,
final float z) {
440 final float[] dir =
new float[3];
442 result =
new Vec3f(dir[0], dir[1], dir[2]);
455 final int rel = isRelative ? 1 : 0;
467 final int[] result =
new int[1];
470 return result[0] == 1;
479 final int loop = isLooping ? 1 : 0;
489 final int[] tmp =
new int[1];
501 final int[] result =
new int[1];
513 final int[] result =
new int[1];
527 if(
null != buffer ) {
532 this.buffer = buffer;
552 final int numBuffers = buffers.length;
553 final int[] arr =
new int[numBuffers];
555 for (
int i = 0; i < numBuffers; i++) {
556 arr[i] = buffers[i].getID();
580 final int numBuffers = buffers.length;
581 final int[] arr =
new int[numBuffers];
583 for (
int i = 0; i < numBuffers; i++) {
584 arr[i] = buffers[i].getID();
603 return "ALSource[id "+sourceID+
", buffer "+buffer+
"]";
A generic exception for OpenAL errors used throughout the binding as a substitute for RuntimeExceptio...
The AudioSystem3D class provides a set of methods for creating and manipulating a 3D audio environmen...
static boolean checkALError(final String prefix, final boolean verbose, final boolean throwException)
Returns true if an OpenAL AL error occurred, otherwise false.
The Sound3D Buffer is a container for audio data used in the Sound3D environment.
void delete()
Delete this buffer, and free its resources.
int getID()
Return the OpenAL buffer ID, -1 if invalid.
This class is used to represent sound-producing objects in the Sound3D environment.
boolean isValid()
Returns whether getID() is valid, i.e.
void unqueueBuffers(final int[] bufferIDs)
Unqueues bufferIDs.length OpenAL buffers on a source.
Vec3f getPosition()
Gets the x,y,z position of the source.
Vec3f getVelocity()
Gets the velocity vector of the source.
float getMaxGain()
SGets the maximum gain for this source.
Source(final int sourceID)
Create a new instance with a given OpenAL source ID.
void rewind()
Rewinds the audio in this source.
int getBuffersProcessed()
Gets the number of buffers already processed on this source.
void queueBuffers(final int[] bufferIDs)
Queues bufferIDs.length OpenAL buffers on a source.
void unqueueBuffers(final Buffer[] buffers)
Unqueues one or more buffers on a source.
Source()
Create a new instance with an invalid OpenAL source ID.
float getPitch()
Gets the pitch of the audio on this source.
void setPitch(final float pitch)
Sets the pitch of the audio on this source.
boolean create()
Creates a new OpenAL source ID if isValid() == false.
float getMinGain()
Gets the minimum gain for this source.
void setConeOuterGain(final float coneOuterGain)
Sets the gain when outside the oriented cone.
float getGain()
Gets the gain of the audio on this source.
float getMaxDistance()
Gets the max distance where there will no longer be any attenuation of the source.
void stop()
Stops the audio in this Source.
void setMaxGain(final float maxGain)
Sets the maximum gain for this source.
void delete()
Delete this source, freeing its resources.
void setSourceRelative(final boolean isRelative)
Determines if the position of the source is relative to the listener.
boolean isPlaying()
Determines whether or not this source is playing.
void setGain(final float gain)
Sets the gain of the audio on this source.
void setVelocity(final Vec3f velocity)
Sets the velocity vector of the source.
Vec3f getDirection()
Gets the direction vector of the source.
void setMaxDistance(final float maxDistance)
Sets the max distance where there will no longer be any attenuation of the source.
void setRolloffFactor(final float rolloffFactor)
Sets the rolloff rate of the source.
float getReferenceDistance()
Gets the distance under which the volume for the source would normally drop by half,...
float getConeOuterGain()
Gets the gain when outside the oriented cone.
boolean isSourceRelative()
Determines if the position of the source is relative to the listener.
int getBuffersQueued()
Gets the number of buffers currently queued on this source.
void setVelocity(final float x, final float y, final float z)
Sets the velocity vector of the source.
void pause()
pauses the audio in this Source.
float getRolloffFactor()
Gets the rolloff rate of the source.
int getID()
Return the OpenAL source ID, -1 if invalid.
void play()
Beginning playing the audio in this source.
void setPosition(final float x, final float y, final float z)
Sets the x,y,z position of the source.
void queueBuffers(final Buffer[] buffers)
Queues one or more buffers on a source.
void setPosition(final Vec3f position)
Sets the x,y,z position of the source.
void setReferenceDistance(final float referenceDistance)
Sets the distance under which the volume for the source would normally drop by half,...
void setLooping(final boolean isLooping)
turns looping on or off.
void setBuffer(final Buffer buffer)
Associates the buffer with this source if buffer is not null, otherwise disassociates the previously ...
boolean getLooping()
indicates whether looping is turned on or off.
void setMinGain(final float minGain)
Sets the minimum gain for this source.
Buffer getBuffer()
Gets the buffer associated with this source.
void setDirection(final Vec3f direction)
Sets the direction vector of the source.
void setDirection(final float x, final float y, final float z)
Sets the direction vector of the source.
A convenience class representing a 3-element float vector.
final float v3
the first element in the vector
final float v2
the first element in the vector
final float v1
the first element in the vector
static final int AL_BUFFERS_PROCESSED
Define "AL_BUFFERS_PROCESSED" with expression '0x1016', CType: int.
static final int AL_MAX_GAIN
Define "AL_MAX_GAIN" with expression '0x100E', CType: int.
static final int AL_BUFFER
Define "AL_BUFFER" with expression '0x1009', CType: int.
static final int AL_PITCH
Define "AL_PITCH" with expression '0x1003', CType: int.
static final int AL_MAX_DISTANCE
Define "AL_MAX_DISTANCE" with expression '0x1023', CType: int.
static final int AL_PLAYING
Define "AL_PLAYING" with expression '0x1012', CType: int.
static final int AL_TRUE
Define "AL_TRUE" with expression '1', CType: int.
static final int AL_MIN_GAIN
Define "AL_MIN_GAIN" with expression '0x100D', CType: int.
static final int AL_REFERENCE_DISTANCE
Define "AL_REFERENCE_DISTANCE" with expression '0x1020', CType: int.
static final int AL_LOOPING
Define "AL_LOOPING" with expression '0x1007', CType: int.
static final int AL_GAIN
Define "AL_GAIN" with expression '0x100A', CType: int.
static final int AL_BUFFERS_QUEUED
Define "AL_BUFFERS_QUEUED" with expression '0x1015', CType: int.
static final int AL_VELOCITY
Define "AL_VELOCITY" with expression '0x1006', CType: int.
static final int AL_SOURCE_RELATIVE
Define "AL_SOURCE_RELATIVE" with expression '0x202', CType: int.
static final int AL_ROLLOFF_FACTOR
Define "AL_ROLLOFF_FACTOR" with expression '0x1021', CType: int.
static final int AL_SOURCE_STATE
Define "AL_SOURCE_STATE" with expression '0x1010', CType: int.
static final int AL_CONE_OUTER_GAIN
Define "AL_CONE_OUTER_GAIN" with expression '0x1022', CType: int.
static final int AL_DIRECTION
Define "AL_DIRECTION" with expression '0x1005', CType: int.
static final int AL_POSITION
Define "AL_POSITION" with expression '0x1004', CType: int.
void alSourcef(int source, int param, float value)
Entry point (through function pointer) to C language function: void alSourcef(ALuint source,...
void alSourcePause(int source)
Entry point (through function pointer) to C language function: void alSourcePause(ALuint source)
void alSource3f(int source, int param, float value1, float value2, float value3)
Entry point (through function pointer) to C language function: void alSource3f(ALuint source,...
void alGetSourcefv(int source, int param, FloatBuffer values)
Entry point (through function pointer) to C language function: void alGetSourcefv(ALuint source,...
void alDeleteSources(int n, IntBuffer sources)
Entry point (through function pointer) to C language function: void alDeleteSources(ALsizei n,...
void alSourcePlay(int source)
Entry point (through function pointer) to C language function: void alSourcePlay(ALuint source)
void alGetSourcei(int source, int param, IntBuffer value)
Entry point (through function pointer) to C language function: void alGetSourcei(ALuint source,...
void alSourcei(int source, int param, int value)
Entry point (through function pointer) to C language function: void alSourcei(ALuint source,...
void alGetSourcef(int source, int param, FloatBuffer value)
Entry point (through function pointer) to C language function: void alGetSourcef(ALuint source,...
void alSourceRewind(int source)
Entry point (through function pointer) to C language function: void alSourceRewind(ALuint source)
void alSourceUnqueueBuffers(int source, int nb, IntBuffer buffers)
Entry point (through function pointer) to C language function: void alSourceUnqueueBuffers(ALuint s...
void alGenSources(int n, IntBuffer sources)
Entry point (through function pointer) to C language function: void alGenSources(ALsizei n,...
boolean alIsSource(int source)
Entry point (through function pointer) to C language function: ALboolean alIsSource(ALuint source)
void alSourceStop(int source)
Entry point (through function pointer) to C language function: void alSourceStop(ALuint source)
void alSourceQueueBuffers(int source, int nb, IntBuffer buffers)
Entry point (through function pointer) to C language function: void alSourceQueueBuffers(ALuint sou...