|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrit.Sound
public class Sound
Provide simple way to load and play sounds in JMRI.
This is placed in the jmri.jmrit package by process of elimination. It doesn't belong in the base jmri package, as it's not a basic interface. Nor is it a specific implementation of a basic interface, which would put it in jmri.jmrix. It seems most like a "tool using JMRI", or perhaps a tool for use with JMRI, so it was placed in jmri.jmrit.
S@see jmri.jmrit.sound
| Nested Class Summary | |
|---|---|
class |
Sound.WavBuffer
|
| Field Summary | |
|---|---|
AudioClip |
audioClip
The actual sound, stored as an AudioClip |
| Constructor Summary | |
|---|---|
Sound(String filename)
|
|
| Method Summary | |
|---|---|
void |
loop()
Play the sound as a loop |
void |
play()
Play the sound once |
static void |
playSoundBuffer(byte[] wavData)
Play a sound from a buffer |
void |
stop()
Stop playing as a loop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public AudioClip audioClip
| Constructor Detail |
|---|
public Sound(String filename)
| Method Detail |
|---|
public void play()
public void loop()
public void stop()
public static void playSoundBuffer(byte[] wavData)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||