com.jogamp.openal.util
Class WAVData

java.lang.Object
  extended by com.jogamp.openal.util.WAVData

public final class WAVData
extends Object

This class is a holder for WAV (.wav ) file Data returned from the WavLoader, or directly via #loadFromStream(InputStream, int, int, int).

Author:
Athomas Goldberg, et.al.

Field Summary
 ByteBuffer data
          The audio data
 int format
          the format of the Data.
 int freq
          The frequency of the data
 boolean loop
          flag indicating whether or not the sound in the data should loop
 int size
          Size (in bytes) of the data
 
Constructor Summary
WAVData(ByteBuffer data, int format, int size, int freq, boolean loop)
           
 
Method Summary
static WAVData loadFromStream(InputStream aIn, int initialCapacity, int numChannels, int bits, int sampleRate, ByteOrder byteOrder, boolean loop)
          This method loads a (.wav) file into a WAVData object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

public final ByteBuffer data
The audio data


format

public final int format
the format of the Data. One of:
 AL.AL_FORMAT_MONO8
 AL.AL_FORMAT_MONO16
 AL.AL_FORMAT_STEREO8
 AL.AL_FORMAT_STEREO16
 


size

public final int size
Size (in bytes) of the data


freq

public final int freq
The frequency of the data


loop

public final boolean loop
flag indicating whether or not the sound in the data should loop

Constructor Detail

WAVData

public WAVData(ByteBuffer data,
               int format,
               int size,
               int freq,
               boolean loop)
Method Detail

loadFromStream

public static WAVData loadFromStream(InputStream aIn,
                                     int initialCapacity,
                                     int numChannels,
                                     int bits,
                                     int sampleRate,
                                     ByteOrder byteOrder,
                                     boolean loop)
                              throws IOException
This method loads a (.wav) file into a WAVData object.

Parameters:
initialCapacity - initial buffer capacity in bytes, if > available bytes
numChannels -
bits -
sampleRate -
byteOrder -
stream - An InputStream for the .WAV stream
Returns:
a WAVData object containing the audio data
Throws:
UnsupportedAudioFileException - if the format of the audio if not supported.
IOException - If the file can no be found or some other IO error occurs