Package arc.audio

Class Audio

java.lang.Object
arc.audio.Audio
All Implemented Interfaces:
Disposable
Direct Known Subclasses:
MockAudio

public class Audio extends Object implements Disposable
High-level wrapper for the Soloud library.
  • Field Details

    • globalPitch

      public float globalPitch
    • falloff

      public float falloff
      Falloff when playing audio.
    • soundBus

      public AudioBus soundBus
      Global bus for all sounds.
    • musicBus

      public AudioBus musicBus
      Global bus for all music.
  • Constructor Details

    • Audio

      public Audio()
      Initializes Soloud audio by default. May throw an exception if initialization fails.
    • Audio

      public Audio(boolean enabled)
      Conditionally initializes audio. If enabled is false, does nothing.
  • Method Details

    • initialized

      public boolean initialized()
    • initialize

      protected void initialize()
      Intializes Soloud audio. If this fails, prints an error and disables audio.
    • newSound

      public Sound newSound(Fi file)
      Loads a sound, logging an error and returning a dummy track upon failure.
    • newMusic

      public Music newMusic(Fi file)
      Loads music, logging an error and returning a dummy track upon failure.
    • isPlaying

      public boolean isPlaying(int soundId)
    • protect

      public void protect(int voice, boolean protect)
    • play

      public int play(AudioSource source, float volume, float pitch, float pan, boolean loop)
    • stop

      public void stop(AudioSource source)
    • stop

      public void stop(int soundId)
    • setPaused

      public void setPaused(int soundId, boolean paused)
    • setLooping

      public void setLooping(int soundId, boolean looping)
    • setPitch

      public void setPitch(int soundId, float pitch)
    • setVolume

      public void setVolume(int soundId, float volume)
    • set

      public void set(int soundId, float pan, float volume)
    • fadeFilterParam

      public void fadeFilterParam(int voice, int filter, int attribute, float value, float timeSec)
    • setFilterParam

      public void setFilterParam(int voice, int filter, int attribute, float value)
    • setFilter

      public void setFilter(int index, @Nullable AudioFilter filter)
    • countPlaying

      public int countPlaying(AudioSource source)
    • dispose

      public void dispose()
      Description copied from interface: Disposable
      Releases all resources of this object.
      Specified by:
      dispose in interface Disposable