Interface Audio


  • public interface Audio
    An abstraction of a native sound or music object.
    Since:
    4.0.9
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void dispose()
      Releases (native) resources associated with this audio.
      boolean isDisposed()
      If this method returns true, no other methods should be called on this audio.
      void pause()
      Pause this audio.
      void play()
      Play (or resume if paused) this audio.
      void setLooping​(boolean looping)
      Set the audio to loop or play once.
      void setVolume​(double volume)
      Set the volume with which to play this audio.
      void stop()
      Stop playing this audio.
    • Method Detail

      • setLooping

        void setLooping​(boolean looping)
        Set the audio to loop or play once.
        Parameters:
        looping - flag to control whether audio is to be played in looping mode
      • setVolume

        void setVolume​(double volume)
        Set the volume with which to play this audio.
        Parameters:
        volume - range [0..1]
      • play

        void play()
        Play (or resume if paused) this audio.
      • pause

        void pause()
        Pause this audio. Next call to play() will resume playing the audio.
      • stop

        void stop()
        Stop playing this audio. Next call to play() will start playing the audio from the beginning.
      • dispose

        void dispose()
        Releases (native) resources associated with this audio. No other methods should be called on this audio after this method returns.
      • isDisposed

        boolean isDisposed()
        If this method returns true, no other methods should be called on this audio.
        Returns:
        whether resources associated with this audio were released