Class Sound

java.lang.Object
io.github.espressoengine.sound.Sound

public class Sound extends Object

Plays sound with javax.sound.sampled. Right now, due to the way these libraries work, you can only use .wav files.

For more information, look at Sound.getClip.
Version:
$Id: $Id
Author:
pastthepixels
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Sound(String path)
    Constuctor that creates a new Sound from a file path by calling Sound.getClip.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Clip
    Gets a clip from a file path.
    void
    Plays the sound on a new thread.
    void
    setLoop(boolean loop)
    Sets the sound clip (javax.sound.sampled.Clip) to loop continuously or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • volume_db

      public float volume_db
  • Constructor Details

    • Sound

      public Sound(String path)
      Constuctor that creates a new Sound from a file path by calling Sound.getClip.
      Parameters:
      path - a String object
  • Method Details