graphics
Class AudioSample
java.lang.Object
graphics.AudioSample
class AudioSample
- extends Object
The sound effects are instanstated as an instance of this class.
- Author:
- Terje
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
clip
private final Clip clip
AudioSample
public AudioSample(InputStream inputStream)
throws IOException
- loads the sound effect from a file.
- Parameters:
inputStream
-
- Throws:
IOException
ensureMarkResetAvailable
private static InputStream ensureMarkResetAvailable(InputStream inputStream)
throws IOException
- Throws:
IOException
readEntireStream
private static byte[] readEntireStream(InputStream inputStream)
throws IOException
- Throws:
IOException
append
private static byte[] append(byte[] data,
int amount,
byte[] array,
int offset)
trim
private static byte[] trim(byte[] data,
int amount)
play
public void play()
- initiatez playbaqck of the sound object.
play
public void play(boolean wait,
boolean loop)
play
private void play(boolean loop)
stop
public void stop()
- Stops playback of the sound object.