Interface Audio

All Known Subinterfaces:
Window
All Known Implementing Classes:
SwingWindow

public interface Audio
Represents a audio context, with playing capability.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets sound from file system.
    boolean
     
    void
    playSound(Sound sound, boolean randomFirstStart, float volume, boolean fadeIn, boolean loop, boolean stopOthersOnStart)
    Play specified sound.
  • Method Details

    • getSound

      Sound getSound(String name)
      Gets sound from file system.
      Parameters:
      name - (String): full name of image, not null
      Returns:
      (Sound): a sound object, null on error
    • playSound

      void playSound(Sound sound, boolean randomFirstStart, float volume, boolean fadeIn, boolean loop, boolean stopOthersOnStart)
      Play specified sound.
      Parameters:
      sound - (Sound): any sound associated to this context, may be null
      randomFirstStart - (boolean): indicate if the first start is random in the sound
      volume - (float): 0.0f no sound, 1.0f full audio
      fadeIn - (boolean): indicate if the song fade in until reaching its max volume
      loop - (boolean): indicate if the sound must loop on self ending
      stopOthersOnStart - (boolean): indicate if all other sound are stopped on given sound's start
    • isSoundSupported

      boolean isSoundSupported()
      Returns:
      (boolean): true if the sound is supported by the Audio