Package org.lwjgl.util
Class WaveData
- java.lang.Object
-
- org.lwjgl.util.WaveData
-
public class WaveData extends java.lang.ObjectUtitlity class for loading wavefiles.- Version:
- $Revision$ $Id$
- Author:
- Brian Matzon
-
-
Field Summary
Fields Modifier and Type Field Description java.nio.ByteBufferdataactual wave dataintformatformat type of dataintsampleratesample rate of data
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WaveDatacreate(byte[] buffer)Creates a WaveData container from the specified bytesstatic WaveDatacreate(java.io.InputStream is)Creates a WaveData container from the specified inputstreamstatic WaveDatacreate(java.lang.String path)Creates a WaveData container from the specified in the classpathstatic WaveDatacreate(java.net.URL path)Creates a WaveData container from the specified urlstatic WaveDatacreate(java.nio.ByteBuffer buffer)Creates a WaveData container from the specified ByetBuffer.static WaveDatacreate(javax.sound.sampled.AudioInputStream ais)Creates a WaveData container from the specified streamvoiddispose()Disposes the wavedata
-
-
-
Method Detail
-
dispose
public void dispose()
Disposes the wavedata
-
create
public static WaveData create(java.net.URL path)
Creates a WaveData container from the specified url- Parameters:
path- URL to file- Returns:
- WaveData containing data, or null if a failure occured
-
create
public static WaveData create(java.lang.String path)
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
public static WaveData create(java.io.InputStream is)
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
public static WaveData create(byte[] buffer)
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
public static WaveData create(java.nio.ByteBuffer buffer)
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
public static WaveData create(javax.sound.sampled.AudioInputStream ais)
Creates a WaveData container from the specified stream- Parameters:
ais- AudioInputStream to read from- Returns:
- WaveData containing data, or null if a failure occured
-
-