Class Sound

java.lang.Object
org.openpatch.scratch.internal.Sound

public class Sound extends Object
The Sound class represents a sound object in Scratch using Java's internal audio classes. Sounds play on a separate thread but only one instance of the sound plays at a time.
  • Constructor Details

  • Method Details

    • loadSound

      public static Clip loadSound(String path)
    • getName

      public String getName()
    • play

      public void play()
      Play the sound. Only one instance will play at a time.
    • pause

      public void pause()
    • stop

      public void stop()
    • isPlaying

      public boolean isPlaying()
    • setVolume

      public void setVolume(double amp)
    • changeVolume

      public void changeVolume(double step)
    • getVolume

      public double getVolume()