34package com.jogamp.openal.test.manual;
36import java.io.IOException;
38import com.jogamp.openal.UnsupportedAudioFileException;
39import com.jogamp.openal.sound3d.AudioSystem3D;
40import com.jogamp.openal.sound3d.Context;
41import com.jogamp.openal.sound3d.Device;
42import com.jogamp.openal.sound3d.Listener;
43import com.jogamp.openal.sound3d.Source;
44import com.jogamp.openal.test.resources.ResourceLocation;
52 public static float lerp(
final float v1,
final float v2,
final float t) {
54 result = v1 + ((v2 - v1) * t);
61 System.err.println(
"AudioSystem3D is not available, static initialization failed");
69 System.err.println(
"Context.makeCurrent() failed");
89 for (
int i = 0; i < 1000; i++) {
90 final float t = (i) / 1000f;
91 final float lp =
lerp(0f, 2f, t);
97 for (
int i = 0; i < 1000; i++) {
98 final float t = (i) / 1000f;
99 final float lp =
lerp(1f, 0f, t);
The AudioSystem3D class provides a set of methods for creating and manipulating a 3D audio environmen...
static Listener getListener()
Get the listener object associated with this Sound3D environment.
static Source loadSource(final String filename)
Loads a Sound3D Source with the specified audio file.
static Device openDevice(final String deviceName)
Opens the named audio device.
static boolean isAvailable()
Returns the available state of this instance.
This class provides a Sound3D Context associated with a specified device.
boolean makeCurrent(final boolean throwException)
Makes the audio context current on the calling thread.
void destroy()
destroys this context freeing its resources.
This class provides a handle to a specific audio device.
void close()
closes the device, freeing its resources.
This class represents the human listener in the Sound3D environment.
void setGain(final float gain)
Sets the Gain, or volume of the audio in the environment relative to the listener.
void setPosition(final float x, final float y, final float z)
Sets the position in (x-y-z coordinates) of the Listener in the Sound3D environment.
This class is used to represent sound-producing objects in the Sound3D environment.
void stop()
Stops the audio in this Source.
void delete()
Delete this source, freeing its resources.
void play()
Beginning playing the audio in this source.
void setPosition(final Vec3f position)
Sets the x,y,z position of the source.
void setLooping(final boolean isLooping)
turns looping on or off.
static void main(final String[] args)
static float lerp(final float v1, final float v2, final float t)
just a tag to locate the resources
static InputStream getTestStream0()
WAV 22050Hz, 1 channel, S8_LE.