public final class WAVData extends Object
#loadFromStream(InputStream, int, int, int)
.Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
WAVData(ByteBuffer data,
int format,
int size,
int freq,
boolean loop) |
Modifier and Type | Method and Description |
---|---|
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.
|
public final ByteBuffer data
public final int format
AL.AL_FORMAT_MONO8 AL.AL_FORMAT_MONO16 AL.AL_FORMAT_STEREO8 AL.AL_FORMAT_STEREO16
public final int size
public final int freq
public final boolean loop
public WAVData(ByteBuffer data, int format, int size, int freq, boolean loop)
public static WAVData loadFromStream(InputStream aIn, int initialCapacity, int numChannels, int bits, int sampleRate, ByteOrder byteOrder, boolean loop) throws IOException
initialCapacity
- initial buffer capacity in bytes, if > available bytesnumChannels
- bits
- sampleRate
- byteOrder
- stream
- An InputStream for the .WAV streamUnsupportedAudioFileException
- if the format of the audio if not
supported.IOException
- If the file can no be found or some other IO error
occurs