Package com.jogamp.openal.util
Class WAVData
- java.lang.Object
-
- 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.
-
-
Constructor Summary
Constructors Constructor Description WAVData(ByteBuffer data, int format, int size, int freq, boolean loop)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WAVDataloadFromStream(InputStream aIn, int byteCount, int numChannels, int bits, int sampleRate, ByteOrder byteOrder, boolean loop)This method loads a (.wav) file into a WAVData object.
-
-
-
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 byteCount, int numChannels, int bits, int sampleRate, ByteOrder byteOrder, boolean loop) throws IOException
This method loads a (.wav) file into a WAVData object.- Parameters:
aIn- An InputStream for the .WAV streambyteCount- byte count of expected wav data to be readnumChannels-bits-sampleRate-byteOrder-- 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
-
-