|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.audio.JOALUtil
public class JOALUtil
JOAL convenience wrapper. Full documentation forthcoming. Please see the attached Processing demo & source distribution of this package for basic usage.
Field Summary | |
---|---|
static java.lang.String |
HARDWARE
|
static java.util.logging.Logger |
logger
|
static java.lang.String |
SOFTWARE
|
Method Summary | |
---|---|
void |
deleteAll()
Deletes & releases all sources and buffers created via this class. |
boolean |
deleteBuffer(AudioBuffer b)
|
boolean |
deleteSource(AudioSource src)
|
boolean |
deleteSource(AudioSource src,
boolean killBuffer)
|
AudioBuffer[] |
generateBuffers(int numBuffers)
Creates the specified number of audio sample buffers and returns an array of AudioBuffer wrappers. |
AudioSource |
generateSource()
Convenience wrapper for generateSources(int) to create a single
AudioSource . |
AudioSource |
generateSourceFromFile(java.lang.String file)
Convenience wrapper bundling loadBuffer(String) &
generateSource() in a single method call. |
AudioSource[] |
generateSources(int numSources)
Creates the specified number of hardware audio sources required to actually play the sample data stored in AudioBuffer s. |
net.java.games.joal.AL |
getAL()
Returns a direct reference to the OpenAL API. |
java.lang.String[] |
getDeviceList()
Retrieves a list of available OpenAL compatible audio devices. |
static JOALUtil |
getInstance()
|
SoundListener |
getListener()
Returns the SoundListener instance for the associated OpenAL
context. |
boolean |
init()
Initializes the OpenAL context. |
boolean |
init(java.lang.String deviceName,
boolean attemptEAX)
Initializes the OpenAL context and if parameter is true, will attempt to also setup an EAX environment. |
boolean |
isEAXSupported()
Checks if EAX are supported by the underlying hardware. |
AudioBuffer |
loadBuffer(java.io.InputStream is)
Loads a WAV file from the given InputStream . |
AudioBuffer |
loadBuffer(java.lang.String fileName)
Loads a WAV file (mono/stereo) from the specified file name |
void |
shutdown()
Destroys all objects, sources, buffers, contexts created by this class. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String HARDWARE
public static java.lang.String SOFTWARE
public static final java.util.logging.Logger logger
Method Detail |
---|
public static JOALUtil getInstance()
public void deleteAll()
public boolean deleteBuffer(AudioBuffer b)
public boolean deleteSource(AudioSource src)
public boolean deleteSource(AudioSource src, boolean killBuffer)
public AudioBuffer[] generateBuffers(int numBuffers)
AudioBuffer
wrappers.
numBuffers
- number of requested buffers
public AudioSource generateSource()
generateSources(int)
to create a single
AudioSource
.
public AudioSource generateSourceFromFile(java.lang.String file)
loadBuffer(String)
&
generateSource()
in a single method call. Generates a new
AudioSource
and assigns the sample buffer created from the given
WAV file.
file
- absolute path to WAV file
public AudioSource[] generateSources(int numSources)
AudioBuffer
s.
numSources
- number of sources required
public net.java.games.joal.AL getAL()
public java.lang.String[] getDeviceList()
init()
.
public SoundListener getListener()
SoundListener
instance for the associated OpenAL
context.
public boolean init()
public boolean init(java.lang.String deviceName, boolean attemptEAX)
shutdown()
meanwhile.
attemptEAX
-
public boolean isEAXSupported()
public AudioBuffer loadBuffer(java.io.InputStream is) throws javax.sound.sampled.UnsupportedAudioFileException, java.io.IOException
InputStream
.
is
- input stream
javax.sound.sampled.UnsupportedAudioFileException
java.io.IOException
public AudioBuffer loadBuffer(java.lang.String fileName)
fileName
- audio file name
java.io.IOException
javax.sound.sampled.UnsupportedAudioFileException
public void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |