JOAL学习笔记
先是例行的连续代码页
import java.nio.ByteBuffer;
import java.util.Random;
import com.jogamp.openal.AL;
import com.jogamp.openal.ALFactory;
import com.jogamp.openal.util.ALut;
public class MultipleSources {
static AL al;
// Maximum number of buffers we will need.
static final int NUM_BUFFERS = 3;
// Maximum emissions we will need.
static final int NUM_SOURCES = 3;
// These index the buffers and sources
static final int BATTLE = 0;
static final int GUN1 = 1;
static final int GUN2 = 2;
// Buffers hold sound data
static int[] buffers = new int[NUM_BUFFERS];
// Sources are points of emitting sound
static int[] sources = new int[NUM_SOURCES];
// Position of the source sounds.
static float[][] sourcePos = new float[NUM_SOURCES][3];
// Velocity of the source sounds
static float[][] sourceVel = new float[NUM_SOURCES][3];
// Position of the listener.
static float[]