paulscode.sound
Class SoundBuffer

java.lang.Object
  extended by paulscode.sound.SoundBuffer

public class SoundBuffer
extends java.lang.Object

The SoundBuffer class is used to wrap audio data along with the format in which the data is stored.

SoundSystem License:

You are free to use this library for any purpose, commercial or otherwise. You may modify this library or source code, and distribute it any way you like, provided the following conditions are met:
1) You may not falsely claim to be the author of this library or any unmodified portion of it.
2) You may not copyright this library or a modified version of it and then sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes made before redistributing the modified source code, so other users know it is not the original code.
4) You are not required to give me credit for this library in any derived work, but if you do, you must also mention my website: http://www.paulscode.com
5) I the author will not be responsible for any damages (physical, financial, or otherwise) caused by the use if this library or any part of it.
6) I the author do not guarantee, warrant, or make any representations, either expressed or implied, regarding the use of this library or any part of it.

Author: Paul Lamb
http://www.paulscode.com


Field Summary
 byte[] audioData
          The actual audio data.
 javax.sound.sampled.AudioFormat audioFormat
          The audio format in which the data is stored.
 
Constructor Summary
SoundBuffer(byte[] audioData, javax.sound.sampled.AudioFormat audioFormat)
          Constructor: Wraps the specified data with the specified audio format.
 
Method Summary
 void cleanup()
          Removes handles to all instantiated objects.
 void trimData(int maxLength)
          Trims down the size of the audio data if it is larger than the specified maximum length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

audioData

public byte[] audioData
The actual audio data.


audioFormat

public javax.sound.sampled.AudioFormat audioFormat
The audio format in which the data is stored.

Constructor Detail

SoundBuffer

public SoundBuffer(byte[] audioData,
                   javax.sound.sampled.AudioFormat audioFormat)
Constructor: Wraps the specified data with the specified audio format.

Parameters:
audioData - The actual audio data.
audioFormat - The audio format in which the data is stored.
Method Detail

cleanup

public void cleanup()
Removes handles to all instantiated objects.


trimData

public void trimData(int maxLength)
Trims down the size of the audio data if it is larger than the specified maximum length.

Parameters:
maxLength - Maximum size this buffer may be.