public class Audio
extends java.lang.Object
| Constructor | Description |
|---|---|
Audio(java.io.InputStream inputStream) |
Constructor for Audio\
*
|
| Modifier and Type | Method | Description |
|---|---|---|
java.io.ByteArrayInputStream |
loadStream(java.io.InputStream inputStream) |
Gets the sound bytes from the stream
|
void |
play() |
Plays a sound clip once and will not replay until the clip has finished
|
void |
play(boolean playOnlyOnce) |
Plays a sound clip once and will not replay until the clip has finished
|
public Audio(java.io.InputStream inputStream)
throws java.io.IOException,
javax.sound.sampled.UnsupportedAudioFileException,
javax.sound.sampled.LineUnavailableException
java.io.IOExceptionjavax.sound.sampled.UnsupportedAudioFileExceptionjavax.sound.sampled.LineUnavailableExceptionpublic java.io.ByteArrayInputStream loadStream(java.io.InputStream inputStream)
throws java.io.IOException
inputStream - the stream used to get the sound bytesjava.io.IOExceptionpublic void play()
throws javax.sound.sampled.UnsupportedAudioFileException,
javax.sound.sampled.LineUnavailableException
javax.sound.sampled.UnsupportedAudioFileExceptionjavax.sound.sampled.LineUnavailableExceptionpublic void play(boolean playOnlyOnce)
throws javax.sound.sampled.UnsupportedAudioFileException,
javax.sound.sampled.LineUnavailableException
playOnlyOnce - boolean that dictates whether the sound should replayjavax.sound.sampled.UnsupportedAudioFileExceptionjavax.sound.sampled.LineUnavailableException