Package arc.audio

Class Music

All Implemented Interfaces:
Disposable

public class Music extends AudioSource

A Music instance represents a streamed audio file. The interface supports pausing, resuming and so on. When you are done with using the Music instance you have to dispose it via the AudioSource.dispose() method.

Music instances are created via Audio.newMusic(Fi).

Music instances are automatically paused and resumed when an Application is paused or resumed. See ApplicationListener.

Note: any values provided will not be clamped, it is the developer's responsibility to do so

  • Constructor Details

    • Music

      public Music(Fi file) throws Exception
      Loads music from a file.
      Throws:
      Exception
    • Music

      public Music()
      Creates an empty music instance. This instance cannot be played until loaded.
  • Method Details

    • load

      public void load(Fi file) throws Exception
      Throws:
      Exception
    • play

      public void play()
    • pause

      public void pause(boolean pause)
    • stop

      public void stop()
    • isPlaying

      public boolean isPlaying()
    • isLooping

      public boolean isLooping()
    • setLooping

      public void setLooping(boolean isLooping)
    • getVolume

      public float getVolume()
    • setVolume

      public void setVolume(float volume)
    • set

      public void set(float pan, float volume)
    • getPosition

      public float getPosition()
    • setPosition

      public void setPosition(float position)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • caches

      protected static Fi[] caches(String name) throws IOException
      Throws:
      IOException