Class Sounds


  • public class Sounds
    extends java.lang.Object
    This class plays .wav files.

    Some free animal sounds can be found: http://www.animal-sounds.org/farm-animal-sounds.html

    • Constructor Summary

      Constructors 
      Constructor Description
      Sounds()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void play​(java.lang.String soundFilename)
      Plays the specified .wav file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Sounds

        public Sounds()
    • Method Detail

      • play

        public static void play​(java.lang.String soundFilename)
        Plays the specified .wav file.

        This method attempts to load the sound file from the file system first. If the file is not found, it attempts to load the sound file from the classpath as a resource.

        Parameters:
        soundFilename - The name of the .wav file to play.