glsound
Class WaveData

java.lang.Object
  extended by glsound.WaveData

public class WaveData
extends java.lang.Object

$Id: WaveData.java,v 1.15 2004/02/26 21:51:58 matzon Exp $ Utitlity class for loading wavefiles.


Field Summary
 java.nio.ByteBuffer data
          actual wave data
 int format
          format type of data
 int samplerate
          sample rate of data
 
Method Summary
static WaveData create(javax.sound.sampled.AudioInputStream ais)
          Creates a WaveData container from the specified stream
static WaveData create(byte[] buffer)
          Creates a WaveData container from the specified bytes
static WaveData create(java.lang.String filepath)
          Creates a WaveData container from the specified filename
 void dispose()
          Disposes the wavedata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

public final java.nio.ByteBuffer data
actual wave data


format

public final int format
format type of data


samplerate

public final int samplerate
sample rate of data

Method Detail

dispose

public void dispose()
Disposes the wavedata


create

public static WaveData create(java.lang.String filepath)
Creates a WaveData container from the specified filename

Parameters:
filepath - path to file (relative, and in classpath)
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(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