|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.util.SoundUtilities
Provides static utility methods for playback of sound.
| Field Summary | |
private static Vector |
currentLines
Lines currently running. |
private static float |
gain
Gain for all lines created through this interface. |
private static boolean |
muted
Whether or not lines created through this interface are muted. |
private static float |
pan
Pan for all lines created through this interface. |
| Constructor Summary | |
SoundUtilities()
|
|
| Method Summary | |
private static void |
applyGain(float gain,
Line l)
Sets the gain for the given line to the given gain. |
private static void |
applyPan(float pan,
Line l)
Sets the pan for the given line to the given pan. |
static float |
getGain()
Returns the gain for all lines created through this interface. |
static float |
getPan()
Returns the pan for all lines created through this interface. |
static boolean |
isMuted()
Returns whether or not sound is muted for all lines created through this interface. |
private static SourceDataLine |
playImpl(AudioInputStream stream)
Plays the given audio input stream. |
private static Thread |
playImpl(Sequence midiSong)
Plays the given MIDI sequence. |
static Thread |
playMidi(File midiFile)
Plays the MIDI sequence stored in the given file. |
static Thread |
playMidi(String midiFileName)
Plays the MIDI sequence stored in a file with the given name. |
static Thread |
playMidi(URL midiURL)
Plays the MIDI sequence stored in the file at the given URL. |
static SourceDataLine |
playSound(File soundFile)
|
static SourceDataLine |
playSound(String soundFileName)
Plays the sound file with the given file name. |
static SourceDataLine |
playSound(URL soundURL)
|
private static void |
removeLine(Line l)
Removes the given line from the list of current lines. |
static void |
setGain(float dB)
Sets the gain for all lines created through this interface to the given gain in dB. |
static void |
setMuted(boolean isMuted)
Sets whether or not sound is muted for all lines created through this interface. |
static void |
setPan(float p)
Sets the pan for all lines created through this interface to the given pan. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static Vector currentLines
private static float gain
private static boolean muted
private static float pan
| Constructor Detail |
public SoundUtilities()
| Method Detail |
public static void setGain(float dB)
dB - the desired gain levelgetGain()public static float getGain()
setGain(float)public static void setMuted(boolean isMuted)
isMuted - whether or not sound is mutedpublic static boolean isMuted()
setMuted(boolean)public static void setPan(float p)
p - the desired pan levelgetPan()public static float getPan()
setPan(float)public static SourceDataLine playSound(String soundFileName)
soundFileName - the file name for the sound to be playedpublic static SourceDataLine playSound(File soundFile)
public static SourceDataLine playSound(URL soundURL)
public static Thread playMidi(String midiFileName)
midiFileName - the file name for the desired sequencepublic static Thread playMidi(File midiFile)
midiFile - the file containing the desired sequencepublic static Thread playMidi(URL midiURL)
midiURL - the URL of the midi file
containing the desired sequenceprivate static SourceDataLine playImpl(AudioInputStream stream)
private static Thread playImpl(Sequence midiSong)
private static void removeLine(Line l)
private static void applyGain(float gain,
Line l)
private static void applyPan(float pan,
Line l)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||