org.newdawn.slick.openal
Class AiffData

java.lang.Object
  extended by org.newdawn.slick.openal.AiffData

public class AiffData
extends java.lang.Object

Utitlity class for loading wavefiles.

Version:
$Revision: 2286 $
Author:
Brian Matzon

Field Summary
 java.nio.ByteBuffer data
          actual AIFF data
 int format
          format type of data
 int samplerate
          sample rate of data
 
Method Summary
static AiffData create(javax.sound.sampled.AudioInputStream ais)
          Creates a AiffData container from the specified stream
static AiffData create(byte[] buffer)
          Creates a AiffData container from the specified bytes
static AiffData create(java.nio.ByteBuffer buffer)
          Creates a AiffData container from the specified ByetBuffer.
static AiffData create(java.io.InputStream is)
          Creates a AiffData container from the specified inputstream
static AiffData create(java.lang.String path)
          Creates a AiffData container from the specified in the classpath
static AiffData create(java.net.URL path)
          Creates a AiffData container from the specified url
 void dispose()
          Disposes the Aiffdata
 
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 AIFF 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 Aiffdata


create

public static AiffData create(java.net.URL path)
Creates a AiffData container from the specified url

Parameters:
path - URL to file
Returns:
AiffData containing data, or null if a failure occured

create

public static AiffData create(java.lang.String path)
Creates a AiffData container from the specified in the classpath

Parameters:
path - path to file (relative, and in classpath)
Returns:
AiffData containing data, or null if a failure occured

create

public static AiffData create(java.io.InputStream is)
Creates a AiffData container from the specified inputstream

Parameters:
is - InputStream to read from
Returns:
AiffData containing data, or null if a failure occured

create

public static AiffData create(byte[] buffer)
Creates a AiffData container from the specified bytes

Parameters:
buffer - array of bytes containing the complete Aiff file
Returns:
AiffData containing data, or null if a failure occured

create

public static AiffData create(java.nio.ByteBuffer buffer)
Creates a AiffData 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:
AiffData containing data, or null if a failure occured

create

public static AiffData create(javax.sound.sampled.AudioInputStream ais)
Creates a AiffData container from the specified stream

Parameters:
ais - AudioInputStream to read from
Returns:
AiffData containing data, or null if a failure occured


Copyright © 2006 New Dawn Software. All Rights Reserved.