|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.neu.ccs.util.SoundUtilities
Provides static utility methods for playback of sound.
| Constructor Summary | |
SoundUtilities()
|
|
| Method Summary | |
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. |
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)
|
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 |
| 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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||