public class Play
extends java.lang.Object
implements java.lang.Runnable
| Modifier and Type | Method and Description |
|---|---|
static void |
play(java.lang.Class resourceOwner,
java.lang.String resourceName)
play a sound file supported by javax.sound.sampled e.g.
|
static void |
play(java.io.File file)
play a sound file supported by javax.sound.sampled e.g.
|
static void |
play(java.net.URL url)
play a sound file supported by javax.sound.sampled e.g.
|
void |
run()
background thread to feed bytes from stream to sound renderer
|
public static void play(java.net.URL url)
throws javax.sound.sampled.UnsupportedAudioFileException,
java.io.IOException
url - usually a resource to play created with Class.getResource.javax.sound.sampled.UnsupportedAudioFileException - if you select a sound file type not supported on this platform.java.io.IOException - if problem retrieving the URLpublic static void play(java.io.File file)
throws javax.sound.sampled.UnsupportedAudioFileException,
java.io.IOException
file - a sound file to playjavax.sound.sampled.UnsupportedAudioFileException - if you select a sound file type not supported on this platform.java.io.IOException - if problem retrieving the file.public static void play(java.lang.Class resourceOwner,
java.lang.String resourceName)
resourceOwner - Class that owns the resourcesresourceName - name of resource with embedded /s.public void run()
run in interface java.lang.Runnable