yops
Class Sound

java.lang.Object
  extended by yops.Sound

public class Sound
extends Object

The Sound class provides methods for playing audio clips with an .au file extension. Students are advised that headphones are generally required in university computer centers.

Author:
Kenneth J. Goldman
Created Jul 5, 2005

Constructor Summary
Sound()
           
 
Method Summary
static AudioClip getSound(String filename)
          Loads, but does not play, an audio clip from the given file
static void loop(String filename)
          Plays the audio clip repeatedly from the given file, loading the audio clip if necessary.
static void main(String[] args)
           
static void play(String filename)
          Plays the audio clip from the given file, loading the audio clip if necessary.
static void stop(String filename)
          Stops playing the named audio clip, if it is currently playing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sound

public Sound()
Method Detail

getSound

public static AudioClip getSound(String filename)
Loads, but does not play, an audio clip from the given file

Parameters:
filename - the name of the audio file
Returns:
the loaded AudioClip

play

public static void play(String filename)
Plays the audio clip from the given file, loading the audio clip if necessary. (If the audio clip has been previously loaded, it will play the clip that has already been loaded.)

Parameters:
filename - the name of the audio file

loop

public static void loop(String filename)
Plays the audio clip repeatedly from the given file, loading the audio clip if necessary. (If the audio clip has been previously loaded, it will play the clip that has already been loaded.)

Parameters:
filename - the name of the audio file

stop

public static void stop(String filename)
Stops playing the named audio clip, if it is currently playing.

Parameters:
filename - the name of the audio file

main

public static void main(String[] args)