public final class Sound
extends java.lang.Object
Constructor and Description |
---|
Sound(java.io.InputStream is,
java.lang.String name)
Creates a new Sound instance by the specified file path.
|
Modifier and Type | Method and Description |
---|---|
javax.sound.sampled.AudioFormat |
getFormat()
Gets the audio format of this sound instance.
|
java.lang.String |
getName()
Gets the name of this instance that is used to uniquely identify the resource of this sound.
|
byte[] |
getRawData()
Gets the raw data of this sound as byte array.
|
java.lang.String |
toString() |
public Sound(java.io.InputStream is, java.lang.String name) throws java.io.IOException, javax.sound.sampled.UnsupportedAudioFileException
Resources.sounds().get(String)
method.is
- The input stream to load the sound from.name
- The name of this sound file.java.io.IOException
- If something went wrong loading the filejavax.sound.sampled.UnsupportedAudioFileException
- If the audio format is not supportedpublic javax.sound.sampled.AudioFormat getFormat()
public java.lang.String getName()
public byte[] getRawData()
This is used during resource serialization.
public java.lang.String toString()
toString
in class java.lang.Object