1package com.jogamp.openal.test.manual;
36import java.io.IOException;
37import java.nio.ByteOrder;
38import java.nio.IntBuffer;
40import com.jogamp.common.nio.Buffers;
41import com.jogamp.openal.AL;
42import com.jogamp.openal.ALC;
43import com.jogamp.openal.ALCcontext;
44import com.jogamp.openal.ALCdevice;
45import com.jogamp.openal.ALConstants;
46import com.jogamp.openal.ALFactory;
47import com.jogamp.openal.ALVersion;
48import com.jogamp.openal.JoalVersion;
49import com.jogamp.openal.UnsupportedAudioFileException;
50import com.jogamp.openal.test.resources.ResourceLocation;
51import com.jogamp.openal.util.WAVData;
57 private static final AL al;
58 private static final ALC alc;
61 private int[] sources =
null;
62 private boolean initialized =
false;
81 System.out.println(
"ALVersion: "+
new ALVersion(al).toString());
83 final int[] buffers =
new int[1];
90 System.out.println(
"*** size "+wd.
data.limit());
98 final int[] loopArray =
new int[1];
109 System.out.println(
"play direct");
114 public void play3f(
final float x,
final float y,
final float z) {
118 System.out.println(
"play3f "+x+
", "+y+
", "+z);
135 if(
null != sources ) {
140 if(
null != context ) {
145 if(
null != device ) {
This class provides factory methods for generating AL and ALC objects.
static AL getAL()
Get the default AL object.
static ALC getALC()
Get the default ALC object.
static JoalVersion getInstance()
StringBuilder toString(final ALC alc, StringBuilder sb)
Return JogampVersion package information and AL informal strings.
void play3f(final float x, final float y, final float z)
static void main(final String[] args)
just a tag to locate the resources
static int getTestStream2Size()
static InputStream getTestStream2()
CDR 44100Hz, 2 channels, S16_LE.
This class is a holder for WAV (.wav ) file Data returned from the WavLoader, or directly via loadFro...
final int format
the format of the Data.
final ByteBuffer data
The audio data.
final int size
Size (in bytes) of the data.
final int freq
The frequency of the data.
static WAVData loadFromStream(InputStream aIn, final int byteCount, final int numChannels, final int bits, final int sampleRate, final ByteOrder byteOrder, final boolean loop)
This method loads a (.wav) file into a WAVData object.
void alcDestroyContext(ALCcontext context)
Entry point (through function pointer) to C language function: void alcDestroyContext(ALCcontext * ...
boolean alcMakeContextCurrent(ALCcontext context)
Entry point (through function pointer) to C language function: ALCboolean alcMakeContextCurrent(ALC...
boolean alcCloseDevice(ALCdevice device)
Entry point (through function pointer) to C language function: ALCboolean alcCloseDevice(ALCdevice ...
ALCdevice alcOpenDevice(String devicename)
Entry point (through function pointer) to C language function: ALCdevice * alcOpenDevice(const ALCc...
ALCcontext alcCreateContext(ALCdevice device, IntBuffer attrlist)
Entry point (through function pointer) to C language function: ALCcontext * alcCreateContext(ALCdev...
static final int AL_BUFFER
Define "AL_BUFFER" with expression '0x1009', CType: int.
static final int AL_TRUE
Define "AL_TRUE" with expression '1', CType: int.
static final int AL_LOOPING
Define "AL_LOOPING" with expression '0x1007', CType: int.
static final int AL_POSITION
Define "AL_POSITION" with expression '0x1004', CType: int.
void alBufferData(int buffer, int format, Buffer data, int size, int samplerate)
Entry point (through function pointer) to C language function: void alBufferData(ALuint buffer,...
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 alGenBuffers(int n, IntBuffer buffers)
Entry point (through function pointer) to C language function: void alGenBuffers(ALsizei n,...
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 alSourceRewind(int source)
Entry point (through function pointer) to C language function: void alSourceRewind(ALuint source)
void alGenSources(int n, IntBuffer sources)
Entry point (through function pointer) to C language function: void alGenSources(ALsizei n,...
void alSourceStop(int source)
Entry point (through function pointer) to C language function: void alSourceStop(ALuint source)