36package com.jogamp.openal.util;
39import java.nio.ByteBuffer;
41import com.jogamp.openal.*;
49 private static ALC alc;
52 private static Thread initializingThread;
60 if (context !=
null) {
61 throw new ALException(
"Already initialized on thread " + initializingThread.getName());
66 final String deviceName =
null;
69 throw new ALException(
"Error opening default OpenAL device");
74 throw new ALException(
"Error creating OpenAL context");
80 throw new ALException(
"Error making OpenAL context current");
85 initializingThread = Thread.currentThread();
95 if (context ==
null) {
103 initializingThread =
null;
108 final ByteBuffer[] data,
119 }
catch (
final Exception e) {
126 final ByteBuffer[] data,
131 if (!(stream instanceof BufferedInputStream)) {
132 stream =
new BufferedInputStream(stream);
140 }
catch (
final Exception e) {
A generic exception for OpenAL errors used throughout the binding as a substitute for RuntimeExceptio...
This class provides factory methods for generating AL and ALC objects.
static ALC getALC()
Get the default ALC object.
static void alutLoadWAVFile(InputStream stream, final int[] format, final ByteBuffer[] data, final int[] size, final int[] freq, final int[] loop)
static synchronized void alutInit()
Initializes the OpenAL Utility Toolkit, creates an OpenAL context and makes it current on the current...
static synchronized void alutExit()
Shuts down the OpenAL Utility Toolkit; releases and destroys the internal OpenAL context and closes t...
static void alutLoadWAVFile(final String fileName, final int[] format, final ByteBuffer[] data, final int[] size, final int[] freq, final int[] loop)
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.
A Loader utility for (.wav) files.
static WAVData loadFromStream(final InputStream stream)
This method loads a (.wav) file into a WAVData object.
static WAVData loadFromFile(final String filename)
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...
int alcGetError(ALCdevice device)
Entry point (through function pointer) to C language function: ALCenum alcGetError(ALCdevice * dev...
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_FALSE
Define "AL_FALSE" with expression '0', CType: int.