jmri.jmrit
Class Sound

java.lang.Object
  extended by jmri.jmrit.Sound

public class Sound
extends Object

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

Author:
Bob Jacobsen Copyright (C) 2004, 2006

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

audioClip

public AudioClip audioClip
The actual sound, stored as an AudioClip

Constructor Detail

Sound

public Sound(String filename)
Method Detail

play

public void play()
Play the sound once


loop

public void loop()
Play the sound as a loop


stop

public void stop()
Stop playing as a loop


playSoundBuffer

public static void playSoundBuffer(byte[] wavData)
Play a sound from a buffer



Copyright © 1997 - 2010 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads