Package org.lwjgl.util
Class WaveData
java.lang.Object
org.lwjgl.util.WaveData
Utitlity class for loading wavefiles.
- Version:
- $Revision$ $Id$
- Author:
- Brian Matzon invalid input: '<'brian@matzon.dk>
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal ByteBuffer
actual wave datafinal int
format type of datafinal int
sample rate of data -
Method Summary
Modifier and TypeMethodDescriptionstatic WaveData
create
(byte[] buffer) Creates a WaveData container from the specified bytesstatic WaveData
create
(InputStream is) Creates a WaveData container from the specified inputstreamstatic WaveData
Creates a WaveData container from the specified in the classpathstatic WaveData
Creates a WaveData container from the specified urlstatic WaveData
create
(ByteBuffer buffer) Creates a WaveData container from the specified ByetBuffer.static WaveData
create
(AudioInputStream ais) Creates a WaveData container from the specified streamvoid
dispose()
Disposes the wavedata
-
Field Details
-
data
actual wave data -
format
public final int formatformat type of data -
samplerate
public final int sampleratesample rate of data
-
-
Method Details
-
dispose
public void dispose()Disposes the wavedata -
create
Creates a WaveData container from the specified url- Parameters:
path
- URL to file- Returns:
- WaveData containing data, or null if a failure occured
-
create
Creates a WaveData container from the specified in the classpath- Parameters:
path
- path to file (relative, and in classpath)- Returns:
- WaveData containing data, or null if a failure occured
-
create
Creates a WaveData container from the specified inputstream- Parameters:
is
- InputStream to read from- Returns:
- WaveData containing data, or null if a failure occured
-
create
Creates a WaveData container from the specified bytes- Parameters:
buffer
- array of bytes containing the complete wave file- Returns:
- WaveData containing data, or null if a failure occured
-
create
Creates a WaveData container from the specified ByetBuffer. If the buffer is backed by an array, it will be used directly, else the contents of the buffer will be copied using get(byte[]).- Parameters:
buffer
- ByteBuffer containing sound file- Returns:
- WaveData containing data, or null if a failure occured
-
create
Creates a WaveData container from the specified stream- Parameters:
ais
- AudioInputStream to read from- Returns:
- WaveData containing data, or null if a failure occured
-