Package jmri.jmrit.sound
Class SoundUtil
java.lang.Object
jmri.jmrit.sound.SoundUtil
Provide simple way to load and play Java 2 sounds in JMRI.
This is placed in the jmri.jmrit.sound 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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]bufferFromFile(String filename, float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian) static voidplaySoundBuffer(byte[] wavData) Play a sound from a buffer.
-
Constructor Details
-
SoundUtil
public SoundUtil()
-
-
Method Details
-
playSoundBuffer
Play a sound from a buffer.- Parameters:
wavData- the .wav byte array.
-
bufferFromFile
public static byte[] bufferFromFile(String filename, float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian) throws IOException, UnsupportedAudioFileException
-