public class Sound
extends java.lang.Object
Constructor and Description |
---|
Sound(java.lang.String fileName)
Create a new sound, loading from the given filename.
|
Sound(java.net.URL url)
Create a new sound, loading from the given URL.
|
Modifier and Type | Method and Description |
---|---|
java.applet.AudioClip |
getClip()
Answer the AudioClip for this sound.
|
void |
loop()
Play the sound repeatedly, until told to stop.
|
void |
play()
Play the sound once, or until told to stop.
|
void |
stop()
Stop playing the sound.
|
static void |
test()
A test method that repeatedly asks for a URL and then plays the
sound given
|
public Sound(java.lang.String fileName)
public Sound(java.net.URL url)
public java.applet.AudioClip getClip()
public void play()
public void loop()
public void stop()
public static void test()