|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAudioFilePlayer
Utility class giving a convenient interface for playing sound from a file. Note that this requires the javax.sound.sampled.* classes that are part of jdk1.3 and up; as such, you should test the version of Java to make sure it's high enough to support this - e.g., String version = System.getProperty("java.version"); if (version.compareTo("1.3") >= 0) { AudioFilePlayer audioPlayer = new AudioFilePlayer("thisJarFile.jar", "mySound.wav"); audioPlayer.playFromJarFile(); }
Constructor Summary | |
AudioFilePlayer(java.lang.String soundFileName)
Create a player for the audio file whose pathname is supplied. |
|
AudioFilePlayer(java.lang.String jarFileName,
java.lang.String soundFileName)
Create a player for the specified audio file contained in the specified jar file. |
Method Summary | |
void |
playFromFile()
Play the associated audio file. |
void |
playFromJarFile()
Play the associated audio file contained in the associated jar file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AudioFilePlayer(java.lang.String soundFileName)
public AudioFilePlayer(java.lang.String jarFileName, java.lang.String soundFileName)
Method Detail |
public void playFromJarFile()
public void playFromFile()
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |