|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--gamingtools.AudioSource
The AudioSource class provides methods for loading music
and sound effect files. The following file formats are supported: AIFF-C,
AIFF, AU, MIDI, MP3, SND, and WAVE. MP3 files should end in ".mp3" and
MIDI files should end in ".mid" or ".midi" for proper
identification.
Note: To play MP3 files, the Java Media Framework must be installed
and jmf.jar must be in the classpath.
SoundEffect,
MidiMusic,
JMFSound| Field Summary | |
static String |
SOUNDS_DIR
Location of the audio files relative to the root package. |
| Method Summary | |
static Audio |
getAudio(String fileName)
Loads an audio file with the specified name from the sounds directory. |
static Audio |
getAudio(String fileName,
AudioListener audioListener)
Loads an audio file with the specified name from the sounds
directory and associates it with an AudioListener. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String SOUNDS_DIR
| Method Detail |
public static Audio getAudio(String fileName)
fileName - Include a path relative to the sounds
directory.
public static Audio getAudio(String fileName,
AudioListener audioListener)
sounds
directory and associates it with an AudioListener.
fileName - Include a path relative to the sounds
directory.audioListener - Called back when the sound effect or the music stops
playing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||