|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindprod.common15.Play
public class Play
Plays a sound using the javax.sound.sampled classes.
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 play
javax.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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |