Package org.lwjgl.util

# Class WaveData

java.lang.Object
org.lwjgl.util.WaveData

public class WaveData extends Object
Utitlity class for loading wavefiles.

Version:
  $Revision$ $Id$
Author:
  Brian Matzon invalid input: '<'brian@matzon.dk>

## Field Summary

Fields
Modifier and Type
Field
Description
`final ByteBuffer`
`data`
actual wave data
`final int`
`format`
format type of data
`final int`
`samplerate`
sample rate of data

## Method Summary

Modifier and Type
Method
Description
`static WaveData`
`create(byte[] buffer)`
Creates a WaveData container from the specified bytes
`static WaveData`
`create(InputStream is)`
Creates a WaveData container from the specified inputstream
`static WaveData`
`create(String path)`
Creates a WaveData container from the specified in the classpath
`static WaveData`
`create(URL path)`
Creates a WaveData container from the specified url
`static WaveData`
`create(ByteBuffer buffer)`
Creates a WaveData container from the specified ByetBuffer.
`static WaveData`
`create(AudioInputStream ais)`
Creates a WaveData container from the specified stream
`void`
`dispose()`
Disposes the wavedata

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### data

public final ByteBuffer data
actual wave data

### format

public final int format
format type of data

### samplerate

public final int samplerate
sample rate of data

## Method Details

### dispose

public void dispose()
Disposes the wavedata

### create

public static WaveData create(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(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(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(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(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